Comments (6)
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
from amazon-cognito-identity-dart-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.
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?
from amazon-cognito-identity-dart-2.
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.
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.
If you have ideas on how to improve this part - welcome to contribute.
from amazon-cognito-identity-dart-2.
Related Issues (20)
- SAML user pool IdP authentication flow HOT 2
- SSO w/ Flutter AWS Cognito HOT 2
- zip file broken HOT 2
- use case 19 HOT 2
- Unauthorized/Anonymus user token HOT 2
- Forgot Password HOT 2
- Melos version bump? HOT 5
- [ASK] Is it possible to getSession with only `refreshToken` value ? HOT 2
- Use case 19 HOT 3
- CognitoUserDeviceConfirmationNecessaryException is not being thrown HOT 3
- Enabling TOTP for MFA HOT 5
- how to solve custom challenge? HOT 3
- Federated Login... Refresh Access Token HOT 2
- AuthenticationDetails.validationData not transmitted HOT 5
- VerifyDevice request fails if username used in sendMFA() is email or phone number HOT 2
- MFA_SETUP challenge when user pool has "required MFA" HOT 3
- sendMFACode method requires SECRET_HASH HOT 2
- How to verify Password Only without session? HOT 2
- "Missing required parameter Session" while MFA is required HOT 4
- Mismatched key prefix when caching and restoring device HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amazon-cognito-identity-dart-2.