我在一个使用基本身份验证的网站上工作。使用Chrome我已经登录使用基本的认证。现在我想从浏览器中删除基本的身份验证细节,并尝试不同的登录。

使用Chrome浏览器时,如何清除当前的基本身份验证细节?


当前回答

正如@SalCelli提到的,chrome://restart工作。但是,这会重新启动所有的选项卡。

另一种方法是采用CEGRD建议的隐身模式

但是,如果你不喜欢在Chrome 86 (Mac)上重新启动和隐身使用,我发现@opsb和Mike提供的答案只适用于以下额外步骤。

Enter the wrong username in the url without the resources eg: if the url is http://mywebsite.com/resources/, it will not work if I enter http://wrong@mywebsite.com/resources/, but will work if I enter only http://wrong@mywebsite.com/ it clears the Basic Auth credentials prompt for the credentials again However, entering the valid credentials will not work, as in the background, chrome still send the wrong user as part of the url, even though the url appears right in the address bar When prompted for credentials you would need to Cancel, and click the address bar and reload the page from pressing enter. Now enter the correct password

其他回答

可能是老帖子了,但想过添加答案来帮助别人。

我在高级ReST客户端应用程序中也遇到了同样的问题,我无法从Chrome和应用程序中清除基本的身份验证。它只是停止要求凭据!

然而,我设法使它通过重新启动Chrome使用关于谷歌Chrome ->重新启动。

一旦Chrome重新启动,当我访问ReST服务,它会要求用户名和密码使用基本身份验证弹出。

希望这能有所帮助!

function logout(url){
    var str = url.replace("http://", "http://" + new Date().getTime() + "@");
    var xmlhttp;
    if (window.XMLHttpRequest) xmlhttp=new XMLHttpRequest();
    else xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    xmlhttp.onreadystatechange=function()
    {
        if (xmlhttp.readyState==4) location.reload();
    }
    xmlhttp.open("GET",str,true);
    xmlhttp.setRequestHeader("Authorization","Basic YXNkc2E6")
    xmlhttp.send();
    return false;
}

右键点击你的书签栏->添加页面… 设置名称为“注销基本认证” 设置URL为:

javascript: (function() {
    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState == 4) {
            location.reload()
        }
    };
    xmlhttp.open("GET", location.origin, true);
    xmlhttp.setRequestHeader("Authorization", "Basic aW52YWxpZDoK");
    xmlhttp.send();
    return false;
})()

在任何需要注销基本认证的网页上,单击书签。

这并不是问题所要问的,但如果你不小心保存了基本的认证凭据,想要清除或更新它们:

https://support.google.com/accounts/answer/6197437

开放的Chrome。 在右上角,单击“更多>”,然后单击“设置”。 在底部,单击Advanced。 在“密码和表单”下,单击“管理密码”。 在“已保存的密码”下,单击要清除已保存的基本身份验证凭据的站点上的删除。

步骤1-4可以通过这个链接快速导航:chrome://settings/passwords

这在Chrome版本59.0.3071.115中工作

你应该能够清除您的凭据从您的浏览器通过“清除浏览数据…”在chrome://设置/高级