我们希望将社交登录与AWS集成在一起。我们从facebook SDK获得facebook令牌,然后将其传递给AWS客户端。但这给出了以下错误。
代码:
AWSMobileClient.getInstance().initialize(SignUpActivity.this, new Callback<UserStateDetails>() {
@Override
public void onResult(UserStateDetails result) {
try {
AWSMobileClient.getInstance().federatedSignIn("graph.facebook.com", token,
new Callback<UserStateDetails>() {
@Override
public void onResult(final UserStateDetails userStateDetails) {
//Handle the result
Log.d("AA", "onResult: " + userStateDetails.getDetails());
}
@Override
public void onError(Exception e) {
Log.e("AAA", "sign-in error", e);
}
});
} catch (Exception e) {
}
}
@Override
public void onError(Exception e) {
}
});
Caused by: com.amazonaws.AmazonServiceException: 1 validation error detected: Value 'us-east-1_xxxxxxxx' at 'identityPoolId' failed to satisfy constraint: Member must satisfy regular expression pattern: [\w-]+:[0-9a-f-]+ (Service: AmazonCognitoIdentity; Status Code: 400; Error Code: ValidationException; Request ID: fd3202ef-abxx-xxxx-xx7c-xxxxxxxxxxx)
请为我们提供解决方案。预先感谢。
答案 0 :(得分:0)
您将需要提供更多详细信息。您对Cognito的要求是什么?看来您可能为AWS请求传递了错误的有效负载。
查看AWS Cognito用户池身份验证文档:https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-userpools-server-contract-reference.html