gpt4 book ai didi

javascript - 用户代理(浏览器)不通过 h​​ttps 提示输入凭据

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:39:11 25 4
gpt4 key购买 nike

当我使用 soap 信封发送此请求时,通过 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

我会在其他浏览器上尝试先丢弃它。

关于javascript - 用户代理(浏览器)不通过 h​​ttps 提示输入凭据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51929473/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com