I'm protecting an API in my web app using passport
. Before hitting the resource, I want the user(from oauth client) to login/authorize first.
Have tried both LocalStrategy
and BasicStrategy
- their implementation are almost 100% the same, just look for a user by email and verify password. If I use BasicStrategy
, the browser will bring up a dailog saying 'Authentication Required' and ask for username & password. However if I use LocalStrategy
, it just says 'Unauthorized', and no chance to login.
So my questions are:
How does browser decide to bring up the login dialog, or is it done by
BasicStrategy
?Is it possible to show a login page with some UI, instead of the simple dialog?
Note that it's part of OAuth process so I don't really want to redirect to the login page.