简体   繁体   English

基本授权在AJAX中不起作用

[英]Basic Authorization not workingin AJAX

I am trying to do some Basic Authorization in Javascript but the Server always returns Error 401. It only works if I login with NTLM in my Browser. 我试图用Javascript做一些基本授权,但是服务器总是返回错误401。仅当我在浏览器中用NTLM登录时,它才起作用。 But I need to access this Server in my Web-App. 但是我需要在我的Web应用程序中访问该服务器。 In the response header it says: 在响应标头中说:

WWW-Authenticate: NTLM

Does this mean that I have to use NTLM? 这是否意味着我必须使用NTLM? And if so, is there a way to do this in javascript for a Web-App? 如果是这样,是否有办法在javascript中为Web应用程序执行此操作?

i am Sorry, if this is just a stupid question, but I can't figure out what to do. 我很抱歉,如果这只是一个愚蠢的问题,但我不知道该怎么办。

btw: The Server is with HTTPS, if that matters :) 顺便说一句:如果服务器很重要,则使用HTTPS :)

Yes, it's looking to do HTTP Basic Authentication with NTLM. 是的,它正在寻找使用NTLM进行HTTP基本身份验证的方法。 You can't do this out-of-the-box with anything other than Internet Explorer brand browsers. 除Internet Explorer品牌的浏览器外,您不能直接使用此功能。 There's a fire fox plugin that does the LDAP integration however. 但是,有一个Fire Fox插件可以进行LDAP集成。

Doing NTLM auth is a three-way handshake, you're best off finding a pre-packaged library to do this for you, as programming the information is actually quite a pain. 进行NTLM身份验证是一种三步握手,最好不要为它准备一个预打包的库,因为对信息进行编程实际上是很痛苦的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM