scientifichackers / flutter_cognito_plugin

An AWS cognito plugin for flutter
GNU Lesser General Public License v3.0
60 stars 28 forks source link

Federated SignIn with Google Sign In, returns no errors, but can't see user in user pool #26

Open robert-stevens opened 4 years ago

robert-stevens commented 4 years ago

Hi,

I have cloned the example app and I have added awsconfiguration.json file with my cognito info.

I then tried using sign up (i.e. email + password) and this worked, and my user was shown in my user pool.

I then added in google_sign_in package:

google_sign_in: ^4.2.0

And did the necessary config.

I ended up using the code below:

signInGoogle() async { final dynamic result = await signInWithGoogle(); Cognito .federatedSignIn('accounts.google.com', result.idToken) .then((res) { print(res); }).catchError((dynamic error) { print(error); }); }

I get a "flutter: UserState.SIGNED_IN" back and the state shows that I'm signed in.

I then go under my groups, e.g.

Groups => eu-west-xxx_Google

But I don't see the user.

I don't have any errors in the app, and so was wondering if you could point me in the right direction to get this working.

Thanks, Robert

Update:

From what I see the user is not logged in, although the federatedSignIn simply returns "UserState.SIGNED_IN" as a response.

subhendukundu commented 4 years ago

Did you get a solution to this?

devxpy commented 4 years ago

Hello, this is a bug in upstream - https://github.com/aws-amplify/aws-sdk-android/issues/685#issuecomment-460349130

devxpy commented 4 years ago

@robert-stevens Using Hosted UI should fix this.