How to stop chrome.webRequest.onAuthRequired from infinite loop when wrong authCredentials is given?
I want to authenticate a web request using the chrome extension. Below code is working perfectly for that. But the problem is that when the given credentials is wrong, the below code will retry indefinitely.
Question
How to stop the infinite loop when wrong authCredentials is given?
My ideal situation will be that when the auth fails then it should fall back to default behavior which in this case will be an Authentication Popup by the browser itself since it is an NTLM authentication type.
chrome.webRequest.onAuthRequired.addListener(
function (details, callback) {
if (callback) {
callback({
authCredentials: {username: 'SampleUsername', password: 'SamplePassword'}
});
}
},
{urls: ['https://www.example.com/*']},
['asyncBlocking']
);
Via Active questions tagged javascript - Stack Overflow https://ift.tt/JZcIChS
Comments
Post a Comment