我正在使用Angular 4,並且在我從我的IdP收到SAML響應後嘗試對給定用戶進行身份驗證,但AWS返回'400身份池ID未找到'錯誤。AWS Cognito,Angular,不識別身份池ID
我確認它是aws控制檯顯示的正確標識,並且所有內容都位於同一區域(us-west-2)。
下面是相關代碼:
//Initialize
let cognitoIdentity = new AWS.CognitoIdentity({apiVersion: 'latest', region: environment.cognitoRegion});
cognitoIdentity.config.credentials = new AWSCognito.CognitoIdentityCredentials({IdentityPoolId: environment.identityPoolId});
cognitoIdentity.config.update({accessKeyId: 'anything', secretAccessKey: 'anything'})
//Setup params for authentication
var params = {
IdentityId: environment.identityPoolId,
Logins: {
[environment.SAMLProviderARN]: '<super long base64 saml response>'
}
};
//Get credentials for user
cognitoIdentity.getCredentialsForIdentity(params, function(err, data) {
//log error or sucessful response
if (err){
console.log(err, err.stack); // an error occurred
}
else {
console.log(data); // successful response
}
});
identityPoolId: 'us-west-2:52xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxd0'
cognitoRegion: 'us-west-2'
SAMLProviderARN: arn:aws:iam::(accountID):saml-provider/secpov-shibboleth
但我仍然得到400 「ResourceNotFoundException:身份 '美西2:52 ...... D0'。找不到」
你能分享你的'環境'變量嗎?我可以檢查Cognito數據存儲以查看池的外觀。 –
已更新w/info – canada11