Flash Actionscript NTLM 身份验证示例?
有没有人有一个使用 NTLM 身份验证从 ActionScript 3.0 调用 Web 服务的示例。 adobe livedocs 列出了支持的 NTLM 身份验证,但我不知道在哪里传递用户凭据。
谢谢, 彼得
Does anyone have an example of calling a webservice from actionscript 3.0 with NTLM authentication in place. The adobe livedocs list NTLM authentication as supported but I can't figure out where to pass user credentials.
Thanks,
Peter
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我相当确定,除非使用 Adobe AIR,否则这是不可能直接实现的。 LiveDocs 中的身份验证信息仅适用于 AIR(方法名称旁边的小符号表示这一点)。
从一些关于 NTLM over HTTP 的快速阅读来看,它看起来需要您根据从服务器返回的 HTTP 状态代码执行多个请求。 这本身就可能存在问题,因为 Flash 在提供这些代码方面充其量是不稳定的。
此外,NTLM 是一种基于连接的方案,要求您在第二个和第三个请求之间保持连接处于活动状态。 Flash 无法发送 keep-alive 标头,也无法创建持久连接。 我倾向于认为这消除了 Flash 在 AS3 中本地进行 NTLM 身份验证的可能性。
但是,我不是 NTLM 专家,并且我引用的文档似乎不是 NTLM over HTTP 规范的官方版本。 我不会说通过 Flash 验证 NTLM 是不可能的——只是看起来无论如何都会非常非常困难。
I'm fairly sure that this is not directly possible except when using Adobe AIR. The authentication info in the LiveDocs is applicable only to AIR (the little symbol next to the method name signifies this).
From some quick reading about NTLM over HTTP it looks like it would require you to do multiple requests based on the HTTP status codes you get back from the server. This in itself could be problematic as Flash is flakey at best with providing those codes.
Further, NTLM is a connection-based scheme and requires that you keep the connection alive between the second and third request. Flash can not send the keep-alive header and can not create persistent connections. I tend to think that this eliminates the possibility of having Flash do NTLM authentication natively with AS3.
However, I am NOT an expert on NTLM and the document I cited does not seem to be an official version of the NTLM over HTTP specification. I will not go so far as to say authenticating NTLM via Flash is impossible - it just looks like no matter what it will be very, very hard.
这在 ActionScript 中是可能的。 服务器将通过向浏览器询问 NTLM 凭据来质疑您发出的每个请求。 然后 Internet Explorer 附加适当的授权标头。 接下来,服务器将验证凭据并提供内容或拒绝访问。
由于所有这些都是在 Flash Player 沙箱不知情的情况下完成的,因此这是我们(沙箱中的开发人员)无法控制的。 因此,我们不能在发出初始请求之前使用 ActionScript 预先附加 NTLM 授权标头,这将绕过“挑战”阶段。 在 Silverlight 中也是如此。
It is possible in ActionScript. Every request you make will be challenged by the server by asking the browser for the NTLM credentials. Then Internet Explorer appends the appropriate authorization header. Next the server will verify the credentials and either serve the content or deny access.
Since all of this is done without the Flash Player sandbox being aware of it, it is something that we (being developers in the sandbox) do not control. So we cannot use ActionScript to pre-append the NTLM authorization header before making the initial request, which would bypass the "challenge" phase. Same is also true in Silverlight.