未调用AWSCognitoIdentityUser getSession

时间:2017-04-07 13:51:55

标签: ios objective-c amazon-web-services authentication

我试图从AWSCognitoIdentityUser获取idToken但是从不调用continue块。可能是什么原因造成的?

AWSCognitoIdentityUserPool *pool = [AWSCognitoIdentityUserPool CognitoIdentityUserPoolForKey:@"UserPool"];
AWSCognitoIdentityUser *user = [pool currentUser];

[[user getSession] continueWithBlock:^id _Nullable(AWSTask<AWSCognitoIdentityUserSession *> * _Nonnull task) {
    //Never called
    return nil;
}];

1 个答案:

答案 0 :(得分:0)

首先启用详细日志记录:[AWSLogger defaultLogger].logLevel = AWSLogLevelVerbose; 这通常有助于确定错误是什么。

听起来您已将AWSCognitoIdentityInteractiveAuthenticationDelegate与您的游泳池相关联。

是否调用了startPasswordAuthentication方法?它是否正确返回AWSCognitoIdentityPasswordAuthentication的实现,并且您在AWSCognitoIdentityPasswordAuthenticationDetails的实现中将passwordAuthenticationCompletionSource.result设置为getPasswordAuthenticationDetails的实例