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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:07:24+00:00 2026-06-04T18:07:24+00:00

I want to see if it is possible to log into a third site

  • 0

I want to see if it is possible to log into a third site that uses HTTP authentication. Ideally, the browser will store the credentials. Unfortunately this fails every time. Any help would be much appreciated, I’m using the base64 Jquery plugin, which I’ve tested to work.

So, two questions:

  1. How can I view the HTTP status code?
  2. Will this ultimately work, in principle?

<script>
$("#login_button").click(function() {   
        var username = 'myFunUsername';
        var password = 'myFunPassword';

        $.ajax({
                url: 'http://remote-site-with-http-auth.com/member_site',
                beforeSend: function(xhr) {
                        xhr.setRequestHeader("Authorization", "Basic " + $.base64.encode(username + ":" + password));
                },
                success: function(data) { $("#label").text("Logged in, yay!"); }
        }).fail(function(){ $("#label").text("It didn't work"); });

});

Thanks!!

  • 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-04T18:07:26+00:00Added an answer on June 4, 2026 at 6:07 pm
    var user= 'myFunUsername';
    var pwd= 'myFunPassword';
            $.ajax({
                    url: 'http://remote-site-with-http-auth.com/member_site',
                    crossDomain:true,
                    username :user,// Keep the variable name different from parameter name to avoid confusion
                    password:pwd,
                    xhrFields: { /* YOUR XHR PARAMETERS HERE */}
    
                    beforeSend: function(xhr) {
                           // Set your headers
                    },
                    success: function(data, textStatus, xhr) {
                        alert(xhr.status);// The status code
                        //Code for success
                    }
            }).fail(function(){ 
                   //Fail code here
                   });
    

    For more details on parameters refer to http://api.jquery.com/jQuery.ajax/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to see the last entry into a table that was triggered
I'm not sure if this is possible but I want to see objects created
We have a site I'll call example.com. Most of the time you see http://www.example.com
I want see all possible paths in some object. How can i do this?
Is it possible to see the DML (SQL Statement) that is being run that
Is it possible to see the last log of Heroku server. I have used
I am working on a program that users can log in to and see
I want see the source code of System.Web.Routing.RouteValueDictionary class. But Reflector can't disassemble it
I want to see if a time I read from a db overlaps with
I want to see a list of all changes the next push would do.

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.