Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to programatically access a password protected website?

Part of our website is protected with .htaccess style password protection. When you try to access this area of the website the web browser pops up a dialog asking for your username and password.

I need to access this programatically (eg with an ajax call). How does the server tell me it needs a password and how do I supply it?

like image 371
Rik Heywood Avatar asked Jul 07 '09 17:07

Rik Heywood


People also ask

How does a password protected website operate?

You can use your account management control panel to protect Web pages with a password. If you do this, anyone trying to view those pages will be asked to enter a user name and password using HTTP authentication. A password actually protects all the Web pages in a certain directory (folder).

Can you build a website that password protected?

Create a Password Protected Website With a Website BuilderIf you're building your website through a website builder like Wix or Weebly, you can easily password protect your website using the tools available to you.

How do I password protect a Hugo website?

Since Hugo is a static site generator, you can't do this directly. However, it can easily be done via the web server engine. So you need to choose a service that supports access to the web server configuration and allows - or has already installed - a plugin such as NGINX auth_request.


1 Answers

Basic HTTP authentication:

http://coderseye.com/2007/how-to-do-http-basic-auth-in-ajax.html

like image 189
mcandre Avatar answered Oct 07 '22 13:10

mcandre