Code Monkey home page Code Monkey logo

Comments (6)

chandong83 avatar chandong83 commented on June 19, 2024 2

hello,
I had the same problem.
In my case it was caused by not adding Facebook ID to "Authentication providers" setting in "identity pool" in "Manage Identity Pools".
https://docs.aws.amazon.com/cognito/latest/developerguide/facebook.html

1
2

from amazon-cognito-identity-dart-2.

devDeejay avatar devDeejay commented on June 19, 2024 2

Google login not working for Android is giving the error:

Unhandled Exception: CognitoClientException{statusCode: 400, code: NotAuthorizedException, name: NotAuthorizedException, message: Token is not from a supported provider of this identity pool.

I configured both of the following after registering the Google SignIn for android app from https://developers.google.com/identity/sign-in/web/sign-in

  • Federation Identity Providers in Cognito Pool and
  • Federated Identities in Identity Pool

Tried multiple times but still no luck. So please help.

from amazon-cognito-identity-dart-2.

subhendukundu avatar subhendukundu commented on June 19, 2024 1

Yes yes, that was it. Dang, I missed that it doesn't support user pool, it supports only the identity pool for social login. So Facebook login is working.
Now issue with Google login. Reading through [aws-openid] (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc.html) I understand if we are using multi clientID we can user OpenID to solve the issue. So I added the open id in IAM with help of this. But it still throwing Invalid login token. Not a valid OpenId Connect identity token.
I have added the following code

final GoogleSignInAccount googleSignInAccount = await _googleSignIn.signIn();
final GoogleSignInAuthentication googleSignInAuthentication = await googleSignInAccount.authentication;
setState(() {
_isLoggedIn = true;
});
print(googleSignInAuthentication);
final _credential = new CognitoCredentials(_identityPoolId, _userPool);
await _credential.getAwsCredentials(googleSignInAuthentication.accessToken, 'accounts.google.com');
print('aws google login done');
print(_credential.sessionToken);

Is it not the googleSignInAuthentication.accessToken?
If I look at first image i see facebook as connected method, is it normal as openid is not showing as openid. What am I missing now?
Screenshot 2020-04-01 at 9 16 42 PM
Screenshot 2020-04-01 at 9 18 02 PM

from amazon-cognito-identity-dart-2.

subhendukundu avatar subhendukundu commented on June 19, 2024

I have no progress on this. Any help?
I tried with a different amplify account too. I am facing the issue.

android facebook:
Unhandled Exception: CognitoClientException{statusCode: 400, code: NotAuthorizedException, name: NotAuthorizedException, message: Token is not from a supported provider of this identity pool.}
ios facebook:
Exception: CognitoClientException{statusCode: 400, code: NotAuthorizedException, name: NotAuthorizedException, message: Token is not from a supported provider of this identity pool.}

android google:
name: NotAuthorizedException, message: Invalid login token. Not a valid OpenId Connect identity token.}
ios google:
code: NotAuthorizedException, name: NotAuthorizedException, message: Invalid login token. Not a valid OpenId Connect identity token.

I am able to fetch the user data, but not able to add it in the Cognito. Did I set up the Cognito wrong?

from amazon-cognito-identity-dart-2.

subhendukundu avatar subhendukundu commented on June 19, 2024

Update: I have changed await _credential.getAwsCredentials(googleSignInAuthentication.accessToken, 'accounts.google.com'); to await _credential.getAwsCredentials(googleSignInAuthentication.idToken, 'accounts.google.com');
This is wokring on iOS but not with android.
As the idToken is null on android. Checking how to fix that.

GoogleSignInAuthentication:{
accessToken: ya29.a0#####################OPMReiWUcSjIUJ50y1EclMQcdIbBEzKE10Fm1vCAeHWr36AgDuuGmOkMRbc_Zd2DJ-gZlzpSYvuj,
idToken: null
}

from amazon-cognito-identity-dart-2.

furaiev avatar furaiev commented on June 19, 2024

If you have ideas on how to improve this part - welcome to contribute.

from amazon-cognito-identity-dart-2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.