过期后刷新DynamoDB凭据

时间:2015-08-26 07:26:20

标签: amazon-dynamodb

我调用以下代码来获取AWS表的DynamoDB凭据。

我的问题是1小时后我的权限到期,当我再次回想起这些例程时,它不会刷新我的凭据而无法访问数据库。

但如果我重新启动我的应用程序就可以了。

如何刷新而无需重新启动应用程序?

AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc]
                                                          initWithRegionType:AWSRegionUSEast1
                                                          identityPoolId:@"us-east-1:*****************"];
    //[credentialsProvider refresh];
    //[AWSServiceManager initialize];
    //[AWSServiceManager dealloc];


    AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:credentialsProvider];

    [AWSServiceManager defaultServiceManager].defaultServiceConfiguration = configuration;

 dynamoDBObjectMapper = [AWSDynamoDBObjectMapper defaultDynamoDBObjectMapper];

0 个答案:

没有答案