Single sign-on with Chrome in Linux

If you are running on Linux machine and. every time you access to your corporate website , it asks you for the password , but this does not happen with your Windows machine. I have spent a lot of times to research on this and found that: Chrome supports some of these authentication method: Basic, NTLM , Negotiate with Kerberos and Certificate.

In this post, i will share how i pass the NTLM authentication by using a chrome extension.

Here are 2 files that i use to create the extension:
webrequest.js

n_try=0;
chrome.webRequest.onAuthRequired.addListener(function(details){
        if(n_try>2)
        {
            return ;
        }
        n_try++;
        console.log("chrome.webRequest.onAuthRequired event has fired");
        return {
                authCredentials: {username: "username", password: "password"}
            };
    },
    {urls:[""]},
    ['blocking']);

manifest.json

{
        "name": "Autologin Extension",
        "version": "1.0",
        "description": "Extension to handle Authentication window",
        "permissions": [
            "webRequest",
            "webRequestBlocking",
            ""
        ],
        "background": {
            "scripts": [
                "webrequest.js"
            ]
        },
        "manifest_version": 2
    }

Leave a Reply

Your email address will not be published. Required fields are marked *