jaredhanson / passport-http

HTTP Basic and Digest authentication strategies for Passport and Node.js.
https://www.passportjs.org/packages/passport-http/?utm_source=github&utm_medium=referral&utm_campaign=passport-http&utm_content=about
MIT License
268 stars 110 forks source link

Response of Basic #17

Open saransh2012 opened 11 years ago

saransh2012 commented 11 years ago

I am using basic authentication for authenticating client credentials in Oauth2orize. In my tests I am using a browser based test-client to do the testing. If the credentials are wrong I get the basic form for user and password being opened to submit username and password.

I don't want that...I just want it to return 401. Is this a problem for browser based client only or is this for all clients? If its for all clients How do I avoid it and just return 401.

rfink commented 8 years ago

+1

barraponto commented 7 years ago

Well, you've got to override how passport.authenticate handles the authentication and just not set that hideous www-authenticate header. Like this:

https://github.com/mws970/find-my-new-iPhone/blob/master/auth/router.js#L23-L34