用户代理(浏览器)不会通过https提示输入凭据

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了用户代理(浏览器)不会通过https提示输入凭据相关的知识,希望对你有一定的参考价值。

当我使用肥皂信封通过http UA发送此请求时要求提供凭据。当我通过https发送时,UA不会要求提供凭据,但会返回401错误。我需要用户以这种方式输入凭证。

 var wsUrl = config.identityServerURL + "/services/RemoteUserStoreManagerService.RemoteUserStoreManagerServiceHttpsSoap11Endpoint/";
        namesToEnable.forEach(function (name) {

            var soapRequest = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.ws.um.carbon.wso2.org" xmlns:xsd="http://common.mgt.user.carbon.wso2.org/xsd"> ' +
                '<soapenv:Header/> ' +
                '<soapenv:Body> ' +
                '<ser:setUserClaimValues>' +
                '<ser:userName>' + name + '</ser:userName>' +
                '<ser:claims> <!--Optional:--> ' +
                '<xsd:claimURI>http://wso2.org/claims/identity/accountDisabled</xsd:claimURI> <!--Optional:--> ' +
                '<xsd:value>false</xsd:value> </ser:claims> <!--Optional:--> ' +
                '<ser:profileName></ser:profileName> </ser:setUserClaimValues> ' +
                '</soapenv:Body></soapenv:Envelope>';

            var xmlhttp = new XMLHttpRequest();
            xmlhttp.open('POST',
                wsUrl, true);

            var sr = soapRequest;

            xmlhttp.onreadystatechange = function () {
                if (xmlhttp.readyState == 4) {
                    if (xmlhttp.status > 200 < 300) {
                        console.log('DONE');
                        sap.ui.getCore().byId("DialogOnEnableUser").close();
                        sap.m.MessageToast.show("User successfully enabled", {duration: 1000});
                    } else {
                        console.log('ERR soap req');
                    }
                }
            };
            // Send the POST request
            xmlhttp.withCredentials = true;
            xmlhttp.setRequestHeader("SOAPAction", "urn:setUserClaimValues");
            xmlhttp.setRequestHeader('Content-Type', 'text/xml');
            xmlhttp.send(sr);
答案

听起来像安全限制,因为网络上缺乏安全连接

https://superuser.com/questions/770897/firefox-does-not-prompt-for-password-for-http-authenticated-sites-how-to-make-i

我会尝试与其他浏览器首先丢弃它。

以上是关于用户代理(浏览器)不会通过https提示输入凭据的主要内容,如果未能解决你的问题,请参考以下文章

ASP.NET Windows 身份验证仅提示一个用户的凭据

安装SQL2008出现了问题,提示SQLserver代理服务器提供的凭据无效,请为SQLserver代理服务器提供有效的账户

安装sql2008时提示sql代理服务提供凭据无效

使用Windows 10系统进行远程连接时,远程桌面连接输入用户名和密码以后提示“您的凭据不工作”无法登陆。

使用服务安装 msi,如果凭据输入错误,是不是有办法强制安装程序重新提示用户

PHP Cookies的学习