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

  • Home
  • SEARCH
  • 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 6029399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:52:49+00:00 2026-05-23T04:52:49+00:00

I am trying to access html files protected by basic authentication. Below is the

  • 0

I am trying to access html files protected by basic authentication. Below is the code to do that but I still get the authentication dialog. I checked the fiddler and found that for the first request authorization header is present but for the subsequent requests which is requested to load the .js, css & images the authorization header is not added. This is the reason I am getting the auth dialog.
Is there a way to add authorization header to the subsequent requests as well?

var loader:HTMLLoader = new HTMLLoader(); 
var be:Base64Encoder = new Base64Encoder(); 
be.insertNewLines = false; 
be.encode("madhur" + ":" + "sharma"); 
var urlRequest:URLRequest = new URLRequest("http://bazinga/myHtmlFiles/index.html"); 

urlRequest.requestHeaders.push(new URLRequestHeader("Authorization","Basic "+ be.toString())); 
page.htmlLoader.load(urlRequest);

Thanks a lot

  • 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-23T04:52:50+00:00Added an answer on May 23, 2026 at 4:52 am

    The above solution didn’t worked for me. Below is the alternate solution.

    URLRequestDefaults.authenticate = false;
    URLRequestDefaults.setLoginCredentialsForHost("bazinga.xyz.com", "madhur", "sharma");
    var req:URLRequest = new URLRequest("http://bazinga.xyz.com/MyHtml/index.html");
    htmlControl.htmlLoader.load(urlRequest);
    

    See related question URLRequestDefaults.setLoginCredentialsForHost not setting the user & pwd in authorization header

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

Sidebar

Related Questions

I want to access html files which are protected by basic authentication. I am
I am trying to access an HTML table from code behind, and set its
I'm trying to access a protected file. Server is using digest authentication - which
Trying to protect video files that are done in camtsia which outputs html/with flash
I'm trying to access the .html files and extract the text in <p> tags.
Trying to get a simple test perl script working. Have the following files/folder structure
I'm currently trying to get a Facebook App up and running. But I get
I am trying to set attributes for an IFRAME html control from the code-behind
I'm trying to install a library that I can use to access Amazon's S3
I'm trying to get a website working on my test environment, but somehow it

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.