Reputation: 1838
Was going through the documentation of Amplify, to configure AWS Cognito hosted UI in Angular 6. Getting 400 Bad request after login.
Below is the info:
Amplify.configure({
Auth: {
region: 'us-east-1',
userPoolId: 'us-east-1_XXXX',
userPoolWebClientId: 'CLIENT_ID',
oauth: {
domain: 'IDP.auth.us-east-1.amazoncognito.com',
scope: ['openid'],
redirectSignIn: 'http://localhost:4200/',
redirectSignOut: 'http://localhost:4200/',
responseType: 'code',
options: {
AdvancedSecurityDataCollectionFlag: true
}
}
}
});
import { Auth} from 'aws-amplify';
onLoginClick() {
Auth.federatedSignIn();
}
Upvotes: 1
Views: 2359
Reputation: 1838
Finally found the solution.
"aws-amplify": "1.1.28",
"@aws-amplify/ui": "1.0.19",
Amplify.configure({
Auth: {
region: 'us-east-1',
userPoolId: 'us-east-1_XXXX',
userPoolWebClientId: 'client_id',
oauth: {
domain: 'idp.auth.us-east-1.amazoncognito.com',
scope: ['openid'],
redirectSignIn: 'http://localhost:4200/',
redirectSignOut: 'http://localhost:4200/',
responseType: 'code',
options: {
AdvancedSecurityDataCollectionFlag: true
}
}
},
Analytics:{
disabled:true
}
});
Upvotes: 2