I wanted to implement a login flow where users can log on my website using
- 3rd party Oauth providers, OR
- Email id and password.
For point 1, I get it that
- Grant type would be "Authorization code".
- My website will redirect the user to 3rd party Oauth provider
- I will get an authorization code and then access token using the code.
For point 2,
- I will be hosting a Oauth server
- I do not want to redirect user to a different page, so "authorization code", "client credentials" and "implicit" grant types isn't what I am looking for.
- Which leaves me with "Resource owner password credentials".
- If I use "Resource owner password credentials" I have to expose the client secret to the web application, which I heard is a bad idea.
My query:
- What is the most appropriate way to get access token without redirecting the user to different page. Currently the authorization server is the server which is hosting the main application. I want this to validate a user using email and password which are stored on my website itself
- If "Resource owner password credentials" is the way to go, what are the security implications of exposing the client secret.
I am new to Oauth so please correct me if I am wrong anywhere.
Note: My Client application is an Angular 2 app in browser.
Thanks.