There is a requirement to make a cross-domain request to a remote service in a chrome extension using ajax.
Everything works correctly when the user is authorized on the service before he uses the extension. But when the unarized user makes the request extension with an error with error code 401 (unaronized).
I need to make a browser similar in appearance . If you are not authorized in any browser window of the web page, you will be prompted to enter your credentials. Because they are the correct contents of the browser web page.
I tried to add some invisible element to the HTML layout extension that lies on the service to make the browser of the built-in domain authorization dialog appear, but the identifier does not seem to be correct.
In short, did you know any strategy to force the built-in browser authorization from the chrome extension or simply through javascript code without redirecting the user to any separate service web page. Or maybe this is not possible and why?
The code that makes the request is simple:
$.ajax({ url: 'service url that requires authorization', dataType: 'json', success: function (info){
WBR, Vitaliy
source share