我正在尝试AWSCognito
在 Objective C 中使用对 Amazon SimpleDB 数据库进行身份验证。我AWSCognitoCredentialsProvider
使用我的 Amazon 帐户中提供的身份池 ID 初始化一个。问题是当我尝试从对象中获取访问密钥和密钥时AWSCognitoCredentialsProvider
,它们是零。
我像这样初始化凭据提供程序:
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;
之后,我试图初始化一个 SimpleDB 客户端,如下所示:
sdbClient = [[AmazonSimpleDBClient alloc] initWithAccessKey:[credentialsProvider accessKey] withSecretKey:[credentialsProvider secretKey]];
难道我做错了什么?