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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:17:37+00:00 2026-06-17T19:17:37+00:00

I have a jquery ajax call that needs to pass an auth header. I’ve

  • 0

I have a jquery ajax call that needs to pass an auth header. I’ve tried several different approaches. But my ajax call currently looks like this…

        $.ajax({
        headers: {"Authorization": "Basic YgBhAHMAaQBjACAAbAAxAHQAdABsADMAcAAxAGcAbAAxAHQAdABsADMAcAAxAGcAOgBsADMAKwBtADMAMQBuAA=="},
        url: fetchurl,
        type: 'GET',
        dataType: 'json',
        async: false,
        contentType: 'application/json; charset=utf-8',
        success: function (data) {
            $.each(data, function (key, val) {
                $('<option/>').attr('value', val.ProductCd)
                    .html(val.ProductCd + " - " + val.Description)
                    .appendTo(productselect);
            });
            $.unblockUI();
        },
        error: function (error, textStatus, errorThrown) {
            alert(textStatus);
        }
    });

I thought my decoding problems might have to do with who was doing the encoding, so I generated that token via the C# class and pasted it into my script code.

I’ve also tried using plugins for encoding in jquery and using the beforesend callback to set the header.

Here I try to decode:

          string authToken = actionContext.Request.Headers.Authorization.Parameter;
          string decodedToken = Encoding.UTF8.GetString(Convert.FromBase64String(authToken));



          string username = decodedToken.Substring(0, decodedToken.IndexOf(":"));
          string password = decodedToken.Substring(decodedToken.IndexOf(":") + 1);

My result is pretty much always the same.

After decoding the auth header I get garbage:
“�w0u�\n�ZXNTLMSSP\0\0\0\0\0\0\0\0X\0\0\0\0\0\0\0X\0\0\0\0\0\0\0X\0\0\0\0\0\0\0X\0\0\0\0\0\0\0X\0\0\0\0\0\0\0X\0\0\0��\0\0\0I���ۛ��l�Y��#��\0\0\0��P-\”��\0\0\0\0”

  • 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-17T19:17:38+00:00Added an answer on June 17, 2026 at 7:17 pm

    OK. It took some hacking but I finally figured out that while I was sending a basic auth from my ajax call, the web api layer was receiving a negotiate auth. So I went into IIS disabled all auth on the web service save for anonymous. And then voila.

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

Sidebar

Related Questions

I have a jQuery AJAX call that I will need to do multiple times
I have a jQuery ajax call that returns html of a table. Now I
A situation I ran across this week: we have a jQuery Ajax call that
I have a web service that returns this string via the jQuery $.ajax() call
I have an AJAX call in my jQuery/PHP app. It needs to send some
I have a jquery Ajax call function that I use to submit form to
I have a simple JS function that needs to get called when AJAX call
I have a jQuery AJAX call with type:'GET' like this: $.ajax({type:'GET',url:'/createUser',data:userId=12345&userName=test, success:function(data){ alert('successful'); }
I have a jquery json ajax call and inside my success function I have
On my main page I have this jquery code which does an ajax call

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.