-
Notifications
You must be signed in to change notification settings - Fork 247
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
StorageAccessDeniedException when connected with social signIn. #2946
Comments
Hi @ClemPalf, sorry you are facing these issues. The social sign-in setup differs a bit in v1 from v0. Can you update your I'm not sure why Storage would behave differently when using social sign-in vs. username/password. I will try to reproduce the issue. |
Thanks @dnys1, your instructions solved the problem for the Android crashing. I didn't see those instructions in the updgrade guide tho, were they provided somewhere else? Now the same issue as with IOS remains, any Storage api call with StorageAccessLevel.protected create an StorageAccessDeniedException. |
The upgrade guide is currently missing this step. I will make sure it gets added. Regarding your storage issue, I'm not able to reproduce it. Are you able to upload with storage access level set to |
It works fine with StorageAccessLevel.guest, but not with StorageAccessLevel.private. I am not sure if it is related, but in case it is relevant: I am also unable to use the Analytics library anymore.
And sometimes (not always) with this extra log:
Which is strange as I only use 2 phones. Otherwise, the API library works fine, even when dealing with models with the @auth { allow: owner } directive. |
Hi @ClemPalf thanks for sharing these details on your problem. Regarding the 'exceeded maximum endpoint per user' error you got, can you provide the code that calls Each call to Unfortunately, AWS Pinpoint does not allow more than 15 endpoints per device. This is an AWS service level choice that they are working to resolve. There is a plan in place to increase the endpoint limit and therefore resolve the hardcoded max endpoint limit of 15. Can you confirm if you've called |
I am facing a similar problem that recently cropped up. It happened once before and I think the only way to solve it was to remove anything linked to auth (storage, graphql), remove auth, readd auth, readd storage, etc... Now all of a sudden it's happened again. Logged in users cannot perform any S3 actions. Looking at the identity pool the new identities are all Unauthenticated according to the dashboard. Output from getCurrentUser() and fetchAuthSession(): flutter: CognitoAuthUser { |
Hello @fjnoyp, There was indeed a problem with how I was getting the user id, sorry about that, and thanks for pointing it out. Now only the StorageAccessDeniedException remains. If I can give you more context (maybe like @BradVidler did with the output of getCurrentUser(), or anything else), do not hesitate to ask! |
Also wondering if deleting a user could have an effect like this. It doesn't seem like there is any trace left anywhere but I have deleted my test user using Amplify.Auth.deleteUser(), as well as deleted all identities in the pool and manually deleted the user in the Amplify backend in an attempt to start from scratch. I have also removed Facebook login entirely and re-added it. Another clue might be to do with adding Pinpoint. I believe I originally only allowed authenticated users but in pinpoint setup it mentioned something about needing unauthenticated permissions as well. I should also mention my @owner models are working as well. EDIT: For some reason my user suddenly had permissions today. I logged out and back in and now those permissions are gone as the user was given a new identity id. |
Fixes #2946. Align logic with username/password login (https://github.com/aws-amplify/amplify-flutter/blob/a010c360376d062eba2c8ac4a01d04a88b555fec/packages/auth/amplify_auth_cognito_dart/lib/src/state/machines/sign_in_state_machine.dart#L539) and refresh AWS credentials upon succesful login.
Thanks for the information. I was able to reproduce the issue and it does appear to be a bug in the Auth library. I've put up a PR fixing it and hope to release it soon after it's merged. |
Glad to hear that! Thanks @dnys1. |
Fixes #2946. Align logic with username/password login (https://github.com/aws-amplify/amplify-flutter/blob/a010c360376d062eba2c8ac4a01d04a88b555fec/packages/auth/amplify_auth_cognito_dart/lib/src/state/machines/sign_in_state_machine.dart#L539) and refresh AWS credentials upon succesful login.
) Fixes aws-amplify#2946. Align logic with username/password login (https://github.com/aws-amplify/amplify-flutter/blob/a010c360376d062eba2c8ac4a01d04a88b555fec/packages/auth/amplify_auth_cognito_dart/lib/src/state/machines/sign_in_state_machine.dart#L539) and refresh AWS credentials upon succesful login.
I am having this issue as well, has it been fixed? |
I have the same issue, but only on android real device, its working well on iOS and android simulator, but when try to download file on android device it is not working and throw this error |
any luck? |
I have also encountered this problem whereby it works fine on MacOS but not so on iOS. Here is the error that I got from the loggs:
|
Description
Hi,
I recently upgraded my amplify libraries to their 1.0 versions, which created many problems. Here is one in particular:
On IOS:
When I try to upload a file to S3 using Amplify.Storage.uploadFile() with accessLevel = protected, when connected to Cognito with SocialSignIn (google):
I always receive the following error: StorageAccessDeniedException, S3 access denied when making the API call.
Yet, when connected with email + password (using Amplify.Auth.signIn()), everything works fine.
On ANDROID:
I can't even connect via the google social signIn anymore, the Amplify.Auth.signInWithWebUI(provider: AuthProvider.google) command always produces the following fatal error:
E/AndroidRuntime( 7685): FATAL EXCEPTION: main E/AndroidRuntime( 7685): Process: com.***.***, PID: 7685 E/AndroidRuntime( 7685): java.lang.RuntimeException: Unable to resume activity {com.***.***/com.amplifyframework.auth.cognito.activities.HostedUIRedirectActivity}: java.lang.IllegalStateException: handleWebUISignInResponse is not supported E/AndroidRuntime( 7685): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:5061) E/AndroidRuntime( 7685): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:5104) E/AndroidRuntime( 7685): at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:60) E/AndroidRuntime( 7685): at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45) E/AndroidRuntime( 7685): at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176) E/AndroidRuntime( 7685): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) E/AndroidRuntime( 7685): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2466)
Did I miss a particular migration step that could have created those problems?
Cheers,
Categories
Steps to Reproduce
ANDROID:
Amplify.Auth.signInWithWebUI( provider: AuthProvider.google,);
.IOS:
Amplify.Auth.signInWithWebUI( provider: AuthProvider.google,);
Amplify.Storage.uploadFile(localFile: awsFile, key: 'avatar_image', options: StorageUploadFileOptions( accessLevel: StorageAccessLevel.protected,),).result;
Screenshots
No response
Platforms
Flutter Version
3.7.12
Amplify Flutter Version
1.0.0
Deployment Method
Amplify CLI
Schema
No response
The text was updated successfully, but these errors were encountered: