Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Amazon Cognito Developer Identities

I am following amazon documentation but it doesn't work as advertised. I have the latest sdk too. The self.identity = code below doesn't work because it is read only.

@implementation DeveloperAuthenticatedIdentityProvider
/*
 * Use the token method to communicate with your backend to get an
 * identityId and token.
 */

- (AWSTask <NSString*>) token {
    //Write code to call your backend:
    //Pass username/password to backend or some sort of token to authenticate user
    //If successful, from backend call getOpenIdTokenForDeveloperIdentity with logins map 
    //containing "your.provider.name":"enduser.username"
    //Return the identity id and token to client
    //You can use AWSTaskCompletionSource to do this asynchronously

    // Set the identity id and return the token
    self.identityId = response.identityId;
    return [AWSTask taskWithResult:response.token];
}

@end

How do I overright this? Thanks.

like image 866
cdub Avatar asked Oct 29 '22 13:10

cdub


1 Answers

You have compiler errors in your other question, fix those first Using AWS Cognito and aws-ios-sdk v.2.4.16 with developer identities

The proper signature for the method, as suggested by the compiler is

- (AWSTask<NSString *> *)token;
like image 137
paiv Avatar answered Nov 12 '22 20:11

paiv