You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
JavaScript Framework
Angular
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
auth
Backend
None
Environment information
# Put output below this line
Describe the bug
We have configured a website to using cognito with aws-amplity version 5 and we had that working fine. When I upgraded to 6 and tried to do the same thing it fails.
aws-amplify version 5:
Using the Auth library we could login with:
We used the Hub to catch all of the messages. When the login is called we are redirected to the correct cognito page and when we try and login we get the following error reported in the Hub:
signInWithRedirect_failure
So clearly the redirectSignIn option of the configuration seems to be working, but I feel like another part of the configuration may be missing given the error code that we get back.
Npm version: 10.5.0
Node Version: v21.7.1
Expected behavior
I expect the redirect call to be able to launch the cognito page and I should be able to login and be redirected with a token to my application.
Hi @elatour2000 thank you for opening this issue - one question i have is to better understand why you are passing the cognito credentials provider. By default, since you are already using cogntio, you shouldn't need to do this. The credentials provider is useful for when you as doing some customizations.
Could you try just passing the ResourceConfig without the credentials provider (especially if you don't need it) to see if you have an issue?
Before opening, please confirm:
JavaScript Framework
Angular
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
auth
Backend
None
Environment information
Describe the bug
We have configured a website to using cognito with aws-amplity version 5 and we had that working fine. When I upgraded to 6 and tried to do the same thing it fails.
aws-amplify version 5:
Using the Auth library we could login with:
and we used the Hub to see the response messages:
Hub.listen('auth', ({ payload: { event } }) => {...}
We used the aws.export.ts file for the configuration:
and we loaded the configuration:
Next we upgraded to aws-amplify 6 (6.0.20) and have the following:
We needed to update the login method to: signInWithRedirect(); and the logout method to: signOut()
https://docs.amplify.aws/javascript/tools/libraries/configure-categories/
We updated the configuration file to JSON:
And we had to load the configurations like this:
We created a new class for the CustomCognitoCredentialsProvider based on this code: https://docs.amplify.aws/javascript/build-a-backend/auth/advanced-workflows/#identity-pool-federation
We used the Hub to catch all of the messages. When the login is called we are redirected to the correct cognito page and when we try and login we get the following error reported in the Hub:
signInWithRedirect_failure
So clearly the redirectSignIn option of the configuration seems to be working, but I feel like another part of the configuration may be missing given the error code that we get back.
Npm version: 10.5.0
Node Version: v21.7.1
Expected behavior
I expect the redirect call to be able to launch the cognito page and I should be able to login and be redirected with a token to my application.
Reproduction steps
Code Snippet
// Put your code below this line.
Log output
aws-exports.js
const aws_amplify_config = {
Auth: {
Cognito: {
userPoolClientId: environment.aws.webclientid,
userPoolId: environment.aws.poolid,
region: environment.aws.region,
loginWith: {
oauth: {
domain: environment.aws.domain,
scopes: ['openid email aws.cognito.signin.user.admin '],
redirectSignIn: [environment.aws.redirectSignIn],
redirectSignOut: [environment.aws.redirectSignOut],
responseType: 'code',
},
email: true,
}
}
}
};
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: