I am trying to authenticate my user using authenticated Cognito and developer identifiers. My question is how to set the identifier with the correct version returned from my iOS backend using objective-c?
If I make calls manually in the code or using a postman, the correct identifier is returned by my server, and Cognito recognizes it and correctly changes the tokens.
The iOS kernel seems to assign an identifier itself, which is not true. I am really trying to understand the documentation as it is outdated and vague.
Here is my code below:
NSLog(@"Complete login"); NSMutableDictionary *merge = [NSMutableDictionary dictionaryWithDictionary:self.credentialsProvider.logins]; [merge addEntriesFromDictionary:logins]; self.credentialsProvider.logins = merge; // Force a refresh of credentials to see if we need to merge task = [self.credentialsProvider refresh]; NSLog(@"Complete login 2-- %@", self.credentialsProvider.identityId); //The identityId assigned is incorrect... NSLog(@"Complete login 2-- %@", self.credentialsProvider.identityPoolId); //The identityPoolId is correct
SOME FLOWERS BELOW: Here's how it works: 1 - When starting the application, a random identifier identifier from Amazon is automatically assigned (therefore, the user is not authenticated initially). 2 - The user enters his credentials, then my code queries the URL for my server, which returns a valid token and the correct identifier for the username and password. 3 - Now this new identifier must be initialized in the code to override the old unverified identifier. 4 - The new idendityId and token that were returned from my server must be sent to Cognito for final authentication, and Cognito returns more authentication. When I speak manually, I send a request through the postman.
In short: 1: How do I change / set my identifier? 2: How to send updated credentials received from my end on my client to Cognito?
ios objective-c amazon-web-services amazon-cognito
Luben
source share