Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8974511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:41:49+00:00 2026-06-15T18:41:49+00:00

There is a demand to make cross domain request to a remote service in

  • 0

There is a demand to make cross domain request to a remote service in chrome extension via ajax.

All works properly while user is authorized on a service before he/she uses the extension. But when an unathorized user makes a request extension fails with 401 error code (unathorized).

My sake is to accomplish browser like appearance. If you aren’t authorized on some webpage browser dialog-box appears suggesting you to input your credentials. Since they are correct browser display webpage content.

I’ve tried to add to extensions HTML layout some invisible element that lies on a service to force browser built-in domain authorization dialog appear, but id doesn’t seem to be correct approach.

Long story short, do you know some strategy to force browser built-in authorization from chrome extension or simply via javascript code without redirecting user to some separate service webpage. Or, maybe, this is impossible and why?

Code that makes request is simple:

$.ajax({
    url: 'service url that requires authorization',
    dataType: 'json',
    success: function (info){
        //success handler
    },
    error: function (){
        //error handler
    }
});

WBR, Vitaliy

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:41:51+00:00Added an answer on June 15, 2026 at 6:41 pm

    I think it is possible to listen to chrome.webRequest.onAuthRequired ( https://developer.chrome.com/trunk/extensions/webRequest.html#event-onAuthRequired). In the event listener, you can prompt the user to enter credentials, say, by showing a custom window that looks like the built-in authorization dialog. onAuthRequired is the only event in chrome.webRequest which supports asynchronized blocking, which allows you to fetch credentials (from the user) asynchronously and pass the response (credentials).

    chrome.webRequest.onAuthRequired.addListener(function(details, callback){
        // Prompt the user to enter credentials. Call 
        // callback({authCredentials: {username: xxx, password: xxx}});
        // when they are ready.
    }, {.../*request filter*/}, ['asyncBlocking']);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to make Django's template loader run all templates it loads
I am thinking about taking the 70-536 exam, and there is all this stuff
I'm trying to make sure that my understanding of IDisposable is correct and there's
Short version: How do I make signed URLs on-demand to mimic Nginx's X-Accel-Redirect behavior
I am wondering if there is much demand for a Flash to C# Converter.
I know, there are a lot of questions here about Installers, but all of
In extension to this question is there a way to obtain the effective URL
We're using CRM On-Demand for our Service Group and I'm running into an application
The service installs correctly but when attempting to start it via net start or
There is a moment in my app, that I need to force to show

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.