0
votes

I can login to AWS S3 using the AWS SDK iOS v 2.1.12 API and correctly provide a list of buckets and objects for the current user in my app using the following authentication:

AWSStaticCredentialsProvider *credentialsProvider = [[AWSStaticCredentialsProvider alloc ]
                                                             initWithAccessKey:secretAccess
                                                             secretKey:secretKey];
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:[region aws_regionTypeValue]
                                                                             credentialsProvider:credentialsProvider];

[AWSS3 registerS3WithConfiguration:configuration forKey:region];

I store the access ID and secret in Keychain in my app. If my user wants to switch user and login to S3 again using different credentials, the token from the previous login is still active and logs the user in with the previous user credentials. If I restart the app this problem goes away and the correct user is logged in.

My question is: is there any way to safely logout from AWS S3 using the API for iOS? If not logout is an option, can I delete/refresh the current login token somehow? Thanks! Cheers, Trond

1

1 Answers

0
votes

I suggest that you use Amazon Cognito to get credentials instead of using the AWSStaticCredetialsProvider in which case you can use clearKeychain api to do handle logout.