Open secure htaccess page without prompts

I have a directory on a website that is password protected via htaccess. I want to be able to open this web page through my application without entering a user password, but to do it programmatically.

For example, is there a way to insert login information into a URL? For example http://www.mypage.com/page.html?htaccesspassword=asdasdas

thank!

+3


source to share


2 answers


scheme://username:password@host/path

      



+8


source


While I find that URL authentication as described by Ignacio Vazquez-Abrams is much simpler, another approach might be with a header Authorization

.

I am assuming you are using Basic authentication.

The header Authorization

looks something like this:

Authorization: basic Base64EncodedCredentials



Where Base64EncodedCredentials

is the username and password, encoded with the Base 64 algorithm in the format

Username: Password

More on this here: http://en.wikipedia.org/wiki/Basic_access_authentication

+1


source







All Articles