I am trying to use AWSCognito
in Objective C to authenticate to an Amazon SimpleDB database.
I initalize an AWSCognitoCredentialsProvider
with the identity pool id provided in my Amazon account. The problem is that when I try to get the access key and secret key from the AWSCognitoCredentialsProvider
object, they are nil.
I initalize the credentials provider likes this:
AWSCognitoCredentialsProvider *credentialsProvider = [AWSCognitoCredentialsProvider credentialsWithRegionType:AWSRegionUSEast1 accountId:ACCOUNT_ID identityPoolId:IDENTITY_POOL_ID unauthRoleArn:UNAUTH_ROLE authRoleArn:AUTH_ROLE];
AWSServiceConfiguration *configuration = [AWSServiceConfiguration configurationWithRegion:AWSRegionUSEast1 credentialsProvider:credentialsProvider];
[AWSServiceManager defaultServiceManager].defaultServiceConfiguration = configuration;
After that, I am trying to initialize a SimpleDB client likes this:
sdbClient = [[AmazonSimpleDBClient alloc] initWithAccessKey:[credentialsProvider accessKey] withSecretKey:[credentialsProvider secretKey]];
Am I doing something wrong?