AWS Cognito iOS Developer Authenticated Identities

北城以北 提交于 2019-11-27 23:21:44

Sorry for all the trouble.

There is a small issue with how the identity provider and credentials provider interact that is not properly documented or handled well. The credentials provider pivots using the unauth or auth role arn based on whether or not there are logins attached on the provider. If you aren’t storing any additional logins on the provider, it will treat it as unauthenticated and use the unauth role and result in the STS error you are seeing. You can work around this by doing something like the following in your identity provider’s refresh:

// add login to the map to make sure CredentialsProvider treats us as authenticated
NSMutableDictionary *temp = [NSMutableDictionary dictionaryWithDictionary:self.logins];
[temp setObject:@"temp" forKey:@"myprovider"];
self.logins = temp;

Update 2015-03-10: You may want to consider looking at our end-to-end example for a better method for handling this.

This the sample, we include the the actual values for the user identifier, then pass the entire contents of the logins property to the backend.

If you're successfully able to do this while unauthenticated, there are a few possibilities here.

First of all, make sure your unauthenticated role arn is different from your authenticated role arn. Additionally, ensure that, in the trust policy (accessible via the appropriate role from this link), the amr points to "authenticated".

If you have any other questions, this blog post goes over the process at a high level.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!