LionC / express-basic-auth

Plug & play basic auth middleware for express
325 stars 57 forks source link

Noob question #10

Closed tpwatson closed 6 years ago

tpwatson commented 6 years ago

To make this work, do I need to create a login page with form fields where I type the admin & password into it, then have those values added to the headers of an auth page request to get authorized?

I understand there's multiple ways to go about this, but I just don't understand how I'm supposed to supply a username and password to get authorized. I see that it parses the headers in order to verify, so I guess I need to write some code that will take my submitted values, and put them into headers for the request that gets authorized?

Just confused if I'm supposed to be using like a post request with the headers to my auth page, or if its as simple as putting URL parameters (example.com/auth?id=admin&password=secret123) and parsing them. I'm all kinds of confused.. I'm sorry

tpwatson commented 6 years ago

Figured it out! I thought Challenge meant that section was a challenge for us to do something with this repo. Didn't realize that challenge is the term for asking a user for credentials! Thanks, its working now 👍