2014-11-04 103 views
0

我正在使用Worklight 6.2 iOS本机框架。我实现了自定义MyChallengeHandler子类ChallengeHandler,并在登录:IBM Worklight 6.2 ChallengeHandler submitFailure:不像预期的那样运行

[[WLClient sharedInstance] login:@"SomeRealm" withDelegate:LoginListener]; 

ChallengeHandler我可以提交成功,这就要求在onSuccess:LoginListener

[self submitSuccess:response]; 

但是,我无法提交失败,我期待在LoginListener中拨打onFailure:。实际上,调用submitFailure:时永远不会在LoginListener中调用,看起来没有任何效果。

此外,我没有在WL ChallengeHandler标题中看到submitFailure:的声明,它仅在BaseChallengeHandler中可用。

我的要点是,目前看起来像LoginListeneronFailure:方法从不调用,但有些情况下handleChallenge:应该失败。并且LoginListener应该被释放。

这是Worklight中的一个已知问题,有没有解决方法?

更新1:

刚刚发现了JS客户端API,这是不是本地有用了类似的问题: Adapter procedure call, reporting an authentication failure

更新2:

这可能是很重要的。我正在使用适配器身份验证,但在IBM示例中有submitLoginForm:,也许我的问题仅适用于适配器身份验证。

[self submitAdapterAuthentication:invocationData options:nil] 
+0

我注意到的第一件事,你写了'ChallangeHandler'而不是'ChallengeHandler'(e不是)。不知道这是否只是在这里或在你的真实代码... – 2014-11-05 06:46:58

+0

(handleChallange而不是'handleChallenge') – 2014-11-05 07:04:03

+0

这是错误的帖子,显然是ChallengeHandler。 – pirags 2014-11-05 09:56:40

回答

0

这是一个很模糊的目前,但我会写我想到的一些可能性。如果有任何帮助,请告知我,我会更新我的答案。

1)您上面的代码表示您使用类ChallangeHandler。我不确定错字是否仅在StackOverflow中或在您的实际代码中,但该类是ChallengeHandler,其中e

handleChallange相同,而不是handleChallenge

2)您是否在某处注册了挑战处理程序?

[[WLClient sharedInstance] registerChallengeHandler:[[MyChallengeHandler alloc] initWithViewController:self] ];

3)你是否得到你LoginListener的成功?你的挑战处理程序?

你是正确的,文件没有提到submitFailure - 我会研究。

但是在我写的代码中,我能够毫无问题地使用它。

@implementation MyChallengeHandler 
//... 
-(void) onSuccess:(WLResponse *)response { 
    NSLog(@"inside challenge success"); 
    [self.vc.navigationController popViewControllerAnimated:YES]; 
    [self submitSuccess:response]; 
} 

-(void) onFailure:(WLFailResponse *)response { 
    NSLog(@"inside challenge failure"); 
    [self submitFailure:response]; 
} 
+0

1)错误 2)是的,我已经注册了ChallengeHandler。 3)是,onSuccess:工作正常。我可以提交成功:在句柄中没有任何问题挑战:。问题只针对submitFailure:,如果我想放弃处理挑战:出于某种原因。 – pirags 2014-11-05 10:04:50

相关问题