I'm making an extension which allows users to store proxy servers with auth credentials (user/pass) and switch between servers. I am listening for the webRequest.onAuthRequired
event and when the server challenges for auth, proving the username/password the user has saved, as per the provideCredentialsSync
example here: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/onAuthRequired#Examples
The problem is that when these credentials are provided, they seem to get saved/cached somewhere in the extension that the developer does not have access to, and then are continually re-used. So, if the extension user then changes their credentials to be incorrect, the browser automatically keeps using the authenticated creds in it's Proxy-Authorization
header and the request succeeds. Vice-versa, if authentication fails, and the request is cancelled as per the above example, then the user changes their creds to be correct, the server does not challenge for authentication again and the request fails with no way to offer the new creds.
Chrome also does not allow modification of the outgoing Proxy-Authorization
header, meaning it cannot be deleted/changed in the code to force the server to challenge again.
So I suppose the core questions are:
Does anyone know where the details are saved when returned from the
webRequest.onAuthRequired
listener, and is there a way to clear/purge?What actually happens when
{cancel: true}
is returned and why do all requests to that server then continue to fail without firing anotheronAuthRequired
?
Thanks for any light anyone can shed!