3

Where can I find the basic HTTP authentication credentials (username and password) in the incoming request to my server?

Is it somewhere in the Request object, or is there some other way to get them?

thanks

user3242743
  • 1,751
  • 5
  • 22
  • 32

1 Answers1

4

When a browser sends HTTP Basic authentication info, it basically sends an HTTP Header named Authorization

with a value of

Basic somethinghere.

The part after Basic is really just Base64.encode("${username}:${password}")

Check out this basic description of the procedure.

Here is a SO answer that describes how you can easily obtain the authentication credentials from the HTTP Header.

Community
  • 1
  • 1
geoand
  • 60,071
  • 24
  • 172
  • 190