-
Notifications
You must be signed in to change notification settings - Fork 550
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
s3 TransferUtility 'Failed to federate the tokens.' only when using facebook signin #829
Comments
This is very similar to the bug I have been reporting, but my issue is with Google federated sign in with AWSMobileClient using the drop in UI. The exception is almost identical. There are related issues: #809
|
Hi @garrettfritz , When using |
Hello @minbi , Thanks, but I don't think the token has expired yet since for the purposes of this test, I am trying to upload immediately after the federated signin is successful, (also immediately after UserStateListener returns a signed in state and token that is valid for an hour). But perhaps I can add a bit more information, I didn't notice this before, but it appears as though AWSMobileClient is clearing all the credentials immediately when I try to upload to S3... this console log is an expanded version of what I sent above, I also am logging at the end that the UserStateListener is ultimately indicating we are now signed out...
|
Can you check that the token in the log matched what you were sending in? I'm not as concerned about the clear of credentials. This happens during the federation process to ensure there are no straggling pieces of state left before a new set of credentials are ingested. |
Hello @minbi yup they are exactly the same, should they be different? |
@garrettfritz Found it...I think. The CognitoAuth library does not return a Facebook token. It returns a Userpools token. Instead of IdentityProviders.FACEBOOK.toString() pass in You can check out our documentation on our recommended approach to what your code currently does Docs CognitoAuth does not support returning a Facebook token. It has been filed as a feature request to the service team. |
ha! look at that, works perfectly, thank you so much @minbi ~G |
Describe the bug
We are using cognito auth for both phone number and facebook login. Once we login, we use the JWT token provided from the awsmobilesdk to authenticate with our API. We also use the mobileSDK to upload to s3 using the bucket setup from the AWSMobileHub.
This is all working fine for phone signup, but when we try to sign in with facebook, we can get everything to work (including getting a valid JWT token) except for uploading to s3, at which point it gives us this error:
To Reproduce
Code to Authenticate using facebook:
Code to use transfer utility:
Which AWS service(s) are affected?
import com.amazonaws.services.s3.AmazonS3Client
import com.amazonaws.mobile.client.AWSMobileClient
import com.amazonaws.mobile.client.UserState
import com.amazonaws.mobile.client.UserStateDetails
import com.amazonaws.mobileconnectors.s3.transferutility
Expected behavior
We would like to upload to s3 when a user signs in with facebook
Screenshots
N/A
Environment Information (please complete the following information):
Additional context
We have almost an identical approach on iOS and it's working great for everything, so we think this might just be an android problem
The text was updated successfully, but these errors were encountered: