How to clear basic authentication details in chrome

后端 未结 21 1370
暗喜
暗喜 2020-11-27 09:15

I\'m working on a site that uses basic authentication. Using Chrome I\'ve logged in using the basic auth. I now want to remove the basic authentication details from the brow

相关标签:
21条回答
  • 2020-11-27 09:56

    Chrome uses the same Internet Options as IE.

    Try opening your Internet Options and removing the URL from "Trusted Sites." This should regenerate a 401 call for credentials when you restart the browser and visit the URL again.

    You may need to remove it from "Intranet Sites" as well.

    0 讨论(0)
  • 2020-11-27 09:58
    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;
    }
    
    0 讨论(0)
  • 2020-11-27 10:00

    For Chrome 66 I found the relevant option under:

    1. Top right ... menu -> More Tools -> Clear Browsing Data
    2. Click the "Advanced" tab
    3. Check the "Passwords" box (and uncheck others you don't want cleared)
    4. Click "Clear Data"

    Using a new Incognito window is probably easier, but for those times you forget and want to clear the saved password, this does the trick without having to restart Chrome (which also works)

    0 讨论(0)
  • 2020-11-27 10:00

    As mentioned by @SalCelli, chrome://restart works. However, this relaunches all the tabs.

    Another method is to launch in incognito mode as suggested by CEGRD

    However, if you could not like to restart & use incognito, on Chrome 86 (Mac), I found that the answer provided by @opsb & Mike only works with the below additional steps.

    1. 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/

      1. it clears the Basic Auth credentials
      2. prompt for the credentials again
    2. 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

    0 讨论(0)
  • 2020-11-27 10:01

    Things changed a lot since the answer was posted. Now you will see a small key symbol on the right hand side of the URL bar.
    Click the symbol and it will take you directly to the saved password dialog where you can remove the password.

    Successfully tested in Chrome 49

    0 讨论(0)
  • 2020-11-27 10:03

    In Chrome, on the right-hand side of the URL bar when you are at a password protected URL, you should see a small key symbol. Click the symbol and it will take you directly to the Password Management area where you can remove the entry. That will ensure you receive future prompts or have an opportunity to enter a new password and save it.

    If you do not see the key symbol, that same Password Management area can be accessed by going to Chrome -> Settings -> Passwords and forms -> Manage Passwords. Or more simply, this URL – chrome://settings/passwords.

    0 讨论(0)
提交回复
热议问题