amplify-js: Federated Sign In - NoUserPoolError: Authentication Error
Describe the bug Using Amplify with AWS AppSync and federated sign in for real-time chat in our Angular 7 app. Issue appears similar to https://github.com/aws-amplify/amplify-js/issues/2445.
The implementation seems to work correctly in terms of functionality and afterwards it seems to recognise the current authenticated user, but I get this NoUserPoolError nonetheless. Debug logs:
[DEBUG] 47:01.813 AuthClass - getting current authenticated user
console.js:35
[DEBUG] 47:01.814 AuthClass - cannot load federated user from auth storage
console.js:35
[DEBUG] 47:01.814 AuthClass - get current authenticated userpool user
[ERROR] 47:01.815 AuthError -
Error: Amplify has not been configured correctly.
The configuration object is missing required auth properties.
[DEBUG] 47:01.820 AuthClass - The user is not authenticated by the error NoUserPoolError: Authentication Error
[DEBUG] 47:02.393 Credentials - Load credentials successfully
[INFO] 47:02.394 Cache - Set item: key is federatedInfo, value is [object Object] with options: [object Object]
console.js:35
[DEBUG] 47:02.395 AuthClass - getting current authenticated user
console.js:35
[DEBUG] 47:02.396 AuthClass - get current authenticated federated user {id: "eu-west-1:XXXXXXXXXXXXXXX", name: ""}
Amplify config:
import Amplify, { Auth } from 'aws-amplify';
Amplify.configure({
Auth: {
identityPoolId: eu-west-1:XXXXXXXXXX,
region: 'eu-west-1',
mandatorySignIn: false
},
aws_appsync_region: 'eu-west-1',
aws_appsync_graphqlEndpoint: https://XXXXXXXXXX.appsync-api.eu-west-1.amazonaws.com/graphql,
aws_appsync_authenticationType: 'AWS_IAM'
});
package.json:
"aws-amplify": "^1.1.38",
"aws-appsync": "^1.7.1",
The similar issue detailed in https://github.com/aws-amplify/amplify-js/issues/2445 was solved by removing the cookie storage from the config but as you can see we do not use that.
In the same way as the above issue we’re not using cognito user pools - only a cognito identity pool.
To Reproduce Attempt federated sign in using the config See error
Expected behavior Successful auth with no errors
Desktop (please complete the following information):
- OS: MacOS 10.14.6
- Browser: Chrome
- Version: 76.0.3809.132
Any advice much appreciated.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 18 (6 by maintainers)
Commits related to this issue
- fix(#4001) — committed to haverchuck/aws-amplify by deleted user 5 years ago
- fix(#4001) — committed to haverchuck/aws-amplify by deleted user 5 years ago
- fix(#4001) (#4131) — committed to aws-amplify/amplify-js by haverchuck 5 years ago
- fix(#4001) (#4131) — committed to Amplifiyer/amplify-js by haverchuck 5 years ago
- Modularization es6 (#4007) * Build ES6 Modules along with CJS Modules * Upgrade Typescript to 3.5 * Upgrade Webpack to 4 * Upgrade Jest to 24 [Delivers #168385455] * Removing unused variable f... — committed to aws-amplify/amplify-js by Amplifiyer 5 years ago
- Modularization es6 (#4007) * Build ES6 Modules along with CJS Modules * Upgrade Typescript to 3.5 * Upgrade Webpack to 4 * Upgrade Jest to 24 [Delivers #168385455] * Removing unused variable f... — committed to computationalcore/amplify-js by Amplifiyer 5 years ago
- Modularization es6 (#4007) * Build ES6 Modules along with CJS Modules * Upgrade Typescript to 3.5 * Upgrade Webpack to 4 * Upgrade Jest to 24 [Delivers #168385455] * Removing unused variable f... — committed to epidemicsound/amplify-js by Amplifiyer 5 years ago
Thanks, but I have updated to aws-amplify@1.1.40 and still see the error.
This worked form me on aws-amplify@^3.x.x
In the AWS Amplify auth JS documentation they suggest to use this: (But that triggers the noUserPoolError)
Hope that helps 😃
Hi - any updates on this issue? Release 1.1.40 did not solve the problem unfortunately.
HI @elorzafe,
I was looking at the
Authclass code and it seems odd to me that thecurrentAuthenticatedUsercode decides whether the user is federated or not just based on theaws-amplify-federatedInfokey from storage. The case where this fails (and the case I am having trouble with) is the initial app load when the storage is empty. The problem with this case is that the code is trying to look forcurrentUserPoolUserwhere I don’t have one as I am using Identity Pool Federation (just like @GWilman). ThecurrentUserPoolUserthen throws as no user pool is specified and all goes to red screen in ReactNative app.Also, while looking at this, I am almost 100% sure that the
Authclass is not using correctStorageHelper. It uses the one imported from@aws-amplify/coreand there is no support for RN AsyncStorage there. What aboutStorageHelper-rnfromamazon-cognito-identity-js.Thanks