-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configured event breaking change not documented #12681
Comments
Hello, @npenin 👋. Just to confirm, is this happening with authenticated users of your app? Can you share the frontend code or file that is calling the |
No this is happening for unauthenticated users. However, they have a cognito identity and an unauthenticated role assigned. The s3 policy allows such user to get files from public access level |
I cannot easily share code as I am building an angular. The authentication flow is not as obvious as depicted here in this bug. I also reverted my code until there is a fix for this bug |
@npenin, understandable. Any code you can share would be very helpful to diagnose what's happening effectively, but let me try and work around that. It sounds like as soon as your app loads, you're using the Auth configure event to send/receive some files maybe without users having to click something. That sound about right? If your app was relying on this event in v5, it's possible the app breaks in v6. Is this the event you were waiting on in v5? amplify-js/packages/auth/src/Auth.ts Line 267 in 848651f
|
@cwomack yes, that's exactly the problem. I am loading a configuration file in my app to then load everything else. However without this |
@npenin, thanks for the confirmation. I'll label this as a bug for now then and review it with the team internally. Will provide updates via this issue as soon as I can! |
@npenin, I've got a potential "workaround" for you to try in v6 to see if we can resolve the problem. Can you try using the The catch here is that if you are trying to use unauthenticated users, that might be an issue. For unauthenticated users, this would provide credentials (but not tokens). So Let me know if this helps and can be used as a workaround in v6! |
As you mentioned, I have unauthenticated users. I had tried the fetchAuthSession, but it did not work out either. |
Got it, thanks for trying that @npenin. Would you mind sharing your frontend code that's making this calls and giving the issue? |
I will do next week after the Christmas break. |
@cwomack This is an issue for me as well on s3 storage. Code below. Note that guest users (UnAuthenitcated) have access to public folder.
|
@npenin I have fixed my issue. The problem is that I was initializing |
@DaneDH on my end, this is a pure front-end issue, but thanks for the suggestion |
@npenin, were you able to review that frontend code then and make a change that resolved the issue for you? Curious if making any of the changes in this comment helped. @DaneDH, are you also unblocked then after moving |
After reviewing this issue further, we're going to mark this as a need for a documentation update to clarify the changes in the events emitted for the Auth channel with Hub in v6. The difference can be seen in reviewing the list of the v5 Auth events vs. the v6 Auth events, but there is no callout for this in our documentation. The We'll track the updates for this clarity to be added in the associated |
My code was also relying in this event. I used i t to do some initialization when a user refreshes the page or did come back to the page while having an active session. |
In addition, I found that when delaying the |
Before opening, please confirm:
JavaScript Framework
Angular, Not applicable
Amplify APIs
Authentication, Storage
Amplify Categories
auth, storage
Environment information
Describe the bug
Before the v6, there used to be a
configured
event in the auth channel. There is no mention of this anywhere of this event in the migration. How can one know when she can use the storage if the auth part is not authenticated yet ?Expected behavior
Either the
Amplify.configure
should return a promise or we need theconfigured
event back or a way to know when Storage is usableReproduction steps
Amplify.configure
line, try to download a file from s3.NoCredentials: Credentials should not be empty.
Code Snippet
// Put your code below this line.
Log output
aws-exports.js
{
Auth: {
Cognito: {
identityPoolId: env.identity_pool_id,
userPoolId: env.user_pool_id,
userPoolClientId: env.app_client_id,
signUpVerificationMethod: 'code',
loginWith: {
oauth: {
"domain": env.login_domain,
"scopes": [
"email",
"openid",
"profile",
"aws.cognito.signin.user.admin"
],
"redirectSignIn": [new URL(location.getBaseHref() + 'oauth', window.location.href).toString()],
redirectSignOut: [new URL(location.getBaseHref(), window.location.href).toString()],
"responseType": "code"
},
}
}
},
Storage: {
S3: {
bucket: env.s3_upload_bucket,
region: aws.region
}
}
}
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: