适配器过程调用,报告身份验证失败 [英] Adapter procedure call, reporting an authentication failure

查看:113
本文介绍了适配器过程调用,报告身份验证失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

客户端代码尝试调用适配器。这会触发对相应领域的身份验证。用户可能没有合适的凭据,最终想要停止尝试。我可以提供一个Give Up按钮,我们可以使用challegeHandler告诉Worklight停止这样的身份验证工作:

Client code attempts to invoke adapter. This triggers authentication to the appropriate realm. It is possible that the user does not have suitable credentials and eventually wants to stop trying. I can provide a "Give Up" button, and we can use the challegeHandler to tell Worklight to stop the authentication effort like this:

this.challengeHandler.submitFailure();

这适用于登录尝试终止的程度,但似乎调用适配器的代码没有回调,因此可能正在等待解决的任何Deferred对象都处于不稳定状态。

This works to the extent that the login attempt terminates, but it seems that code calling the adapter gets no callback and hence any Deferred objects that might be waiting for resolution are left in limbo.

问题是我们是否可以安排将身份验证失败返回给调用者适配器程序?

The question is whether we can arrange to get the authentication failure back to the caller of the adapter procedure?

推荐答案

我已被告知此问题的解决方法,您致电:

I have been informed of a workaround to this issue whereby you call:

challengeHandler.activeRequest.onUnresponsiveHost() 

在实际呼叫之前:

challengeHandler.submitFailure()

这将触发失败并按预期拒绝延期。

This will trigger the failure and reject the deferred as intended.

这是一种解决方法,但它可能在以后的版本中不起作用。我将提出一个增强请求(链接待处理),如果你能投票支持,我将不胜感激,以确保将来可以使用此功能。

This is a workaround though so it might not work in future versions. I am going to raise a request for enhancement (link pending) and I would appreciate it if you could vote it up as well to ensure this functionality is available in the future.

这篇关于适配器过程调用,报告身份验证失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆