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 436585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:29:34+00:00 2026-05-12T20:29:34+00:00

My users enter a username and password for a third party service. I do

  • 0

My users enter a username and password for a third party service. I do an ajax call to that service to authenticate them. The issue is that if they enter the wrong username and password the browser (at least firefox) will display an “authentication required” dialog. If they then enter the correct username and password in that dialog, my ajax call will return a “success”, and it will appear that the original user/pass they entered was correct, when it is not (since they changed it).

Is there any way to either suppress this dialog (so I can then have my service tell them to correct their user/pass) or somehow grab the correct username and password that the user entered in the browsers dialog? This is a firefox extension.. so I’m sure there is some way to grab the correct pass/login from the request.. but It would be nice if there was a simpler method via javascript.

jQuery.ajax({
  type: "GET",
  dataType: "xml",
  url: endpoint,
  username: username,
  password: password,
  success: function(data,status) {
    // Do something
  },
  error: function(XMLHttpRequest, textStatus, errorThrown){
    alert(errorThrown);
  }
});
  • 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-05-12T20:29:34+00:00Added an answer on May 12, 2026 at 8:29 pm

    I’ve solved this problem by putting a proxy in between the browser and the service that requires authentication, in my case, a java servlet. The browser sends the AJAX request to the servlet, which forwards the request to the service, then sends back the services’ response, omitting the “WWW-Authenticate” header. Your browser app. handles the HTTP 200 or 401 response code accordingly.

    Similarly, the proxy could always return a 200 with a json response indicating the results of the forwarded request. This way you can discern the difference between a failure of your proxy and the response of the service.

    One tricky thing you may have to deal with – if the far-end service responds with a set-cookie header, say because it’s created a session for your client, then you have (at least) 2 possible paths to take.

    1. your proxy will remember the cookie, your browser app. always goes through the proxy for this service, and the proxy adds this cookie to the subsequent forwarded requests.
      or
    2. you ignore the service’s cookie, and have the browser re-authenticate directly with the service once you’ve verified the username and password via the proxy. Though this may have the side-effect of creating an orphaned session with the service
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a login form that includes a username and password field. Users will
I have multiple fields for social networking websites where users can enter their username
I have a website which requires users to enter their corporate network username and
I have a site where users can enter their profile and password-protect certain details.
Our website lets users create small widgets that can be embedded on other third
I have a login page. When the user enters valid Username and Password another
On websites where you have to enter a user name and password, I notice
I have text to localize like this <p>Please enter your user name and password.
in my application i have an form where user enter their username first .
Users enter text through a text area element, much like we enter questions on

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.