Federico
Federico

Reputation: 55

How to include log-in credentials in GET/POST methods?

I have set a .htpasswd in my webpage which is working fine, because the data included is sensitive.

When I try to do something like this:

www.mywebpage.com/example.php?var=1&set=0

It does reply an expected error msg:

Authorization Required

This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.

How do I include user & password in the above request?

Upvotes: 0

Views: 566

Answers (1)

lexx9999
lexx9999

Reputation: 746

http://user:[email protected]/example.php?var=1&set=0 Take care for escaping characters if necessary. (see RFC3986 https://www.rfc-editor.org/rfc/rfc3986#page-18 )

Note: User name and password likely is logged in the webserver's logs as plain text.

Upvotes: 1

Related Questions