Open anggrayudi opened 5 years ago
@sunchunqiang Try to use empty or random string as the JWT token, and AWSMobileClient.getInstance().federatedSignIn()
will accept it as valid login token. Then onResult()
will be called and showing success state. I have browsed federatedSignIn()
source code, and found that this method only save login information into SharedPreferences
, instead of saving it to the cloud.
Using federatedSignIn()
should handle sign in flow easily. If we need to combine it with API Gateway, Lambda, IAM, etc in order to make a simple login flow, then it will make login feature harder to learn. federatedSignIn()
should be used to sign up if users do not have any account yet, and it handle sign in method as well. When users choose Google login, they don't need to sign up again when they want to change login method to default user pools through username and password. All users information must be updated into Cognito User Pools too.
We have to minimize learning curve when using AWS SDK APIs.
Hi @anggrayudi ,
The federatedSignIn()
method only supports federation into Cognito Identity Pool which is why you saw the code store it locally (the actual federation code reads it from the store). Federation into Cognito User Pools is only supported through the HostedUI feature. This is currently achieved using the aws-android-sdk-cognitoauth
library which launches a web-based UI. This is currently a service limitation and we are working with the service team to find a resolution.
Response migrated to https://github.com/aws-amplify/aws-sdk-android/issues/693
Response migrated to https://github.com/aws-amplify/aws-sdk-android/issues/693
@anggrayudi #693 might help you as this works for User pool and google login
Describe the bug When sign in or login using Cognito's User Pools, there's no problem. Here's the screenshot. Users are registered correctly.
When I use Google Identity Provider, I open Google login group. But no users on it, even though the login is success.
This is my code:
I also read my
awsconfiguration.json
carefully, and I did nothing wrong. I have setGoogle web app ID
,Android Client ID
, andApp secret
as well.So, where did all users signed in with Google go?
Environment