jshttp / basic-auth

Generic basic auth Authorization header field parser
MIT License
702 stars 86 forks source link

Questions about realms #30

Closed adam-beck closed 7 years ago

adam-beck commented 7 years ago

I understand what a realm is (I think) and in the example I see one is added to the header: res.setHeader('WWW-Authenticate', 'Basic realm="example"'). Is there any information on how this works or how to define different realms in node.js/express servers?

dougwilson commented 7 years ago

That is probably a bit beyond this module, which all it does it parse a header with basic auth credentials back to username / password. The most I can really say is already in the README.

dougwilson commented 7 years ago

From reading https://tools.ietf.org/html/rfc2617 and various other sites, the realm is for the pages which share the same credentials. The way you specify it is to send a WWW-Authenticate headers with the realm named. That's pretty much what I got from reading around.

adam-beck commented 7 years ago

Thank you for your time addressing this