I have a developer authenticated identity set for Amazon Cognito us in my iOS app
I have followed the tutorial in the documentation: Using Developer Authenticated Identities
My backend is able to generate tokens and get identityIds with no problem. And I am able to initialize cognito in my iOS app as instructed. But I upon making a dynamoDb request I get the error
The security token included in the request is invalid
Cognito initialization Code:
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;
}];
Does anyone know what I might be doing wrong ?
Aucun commentaire:
Enregistrer un commentaire