仔细阅读Amplify的文档,以在Angular 6中配置AWS Cognito托管的UI。 登录后收到400错误的请求。
以下是信息:
ActionsTableView.TableFooterView = new UIView() { Frame = new CGRect(0, 0, ActionsTableView.Frame.Size.Width, 1) };
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
}
}
}
});
答案 0 :(得分:1)
最后找到了解决方案。
"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
}
});