我在我的 iOS 应用程序中为我们的 Amazon Cognito 设置了开发人员身份验证身份
我已按照文档中的教程进行操作: 使用 Developer Authenticated Identities
我的后端能够毫无问题地生成令牌并获取 identityIds。而且我可以按照指示在我的 iOS 应用程序中初始化 cognito。但是我在发出 dynamoDb 请求时收到错误消息
The security token included in the request is invalid
Cognito 初始化代码:
MyIdentityProvider *identityProvider = [MyIdentityProvider new];
[identityProvider setIdentityPoolId:COGNITO_POOL_ID];
AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc]
initWithRegionType:AWSRegionUSEast1
identityProvider:identityProvider
unauthRoleArn:nil
authRoleArn:COGNITO_ROLE_AUTH];
AWSServiceConfiguration *configuration = [AWSServiceConfiguration configurationWithRegion:AWSRegionUSEast1
credentialsProvider:credentialsProvider];
[AWSServiceManager defaultServiceManager].defaultServiceConfiguration = configuration;
[[credentialsProvider getIdentityId] continueWithSuccessBlock:^id(BFTask *task){
//In here I can see that everything is ok.
//I have a token and cognitoId
//But despite this, when I make requests I get "The security token included in the request is invalid"
return nil;
}];
有谁知道我可能做错了什么?