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!
source to share
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
source to share