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

时间:2018-08-20 11:09:33

标签: javascript xmlhttprequest wso2

当我使用肥皂袋在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);

1 个答案:

答案 0 :(得分:0)

由于对网络缺乏安全连接的持续斗争,对我来说听起来像是安全限制

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

我会尝试与其他浏览器一起将其丢弃。