-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to create a correct user authentication flow #1
Comments
I am trying to creating an oauth2 driven web API using node-oauth2-server |
@ngoyal16 What do you need? |
@slavab89 it is not having login authorize pages.. to get the the user acess the client application have to pass the username and password of the user.. |
nitingoyal95@live.com is my skype id.. |
No it does not have authentication pages. |
i want to create my own oauth service. so that i can integrate other application can use it to login and user can authorize them to access the profile.. like facebook login, google login. |
You can use something like https://github.com/panva/node-oidc-provider then The person who wrote it also has a client that integrated with it from the other side See his examples and working page on how to set this up. I've ended up using it because it provides authentication (login) & authorization - same flow when you login to google |
I want to setup own oAuth system like google OAuth and facebook OAuth... where a user can also authorize the application. the open id is provided the feature to integrate multiple OAuth services to the single point. but this is not my requirement. |
First of all, i think you can ask it as a general question on stackoverflow or something. You might want to check those issues out cause they explain a bit more how the flow should work |
i clone repo to my server but i am getting error..... it is not allowing to run any other grant_type so i am not able to to get the access_token as well |
So after creating a working example for this i now need to start working with it :)
The question is what is the correct flow.
My architecture is going to be something like the following:
https://dglozic.files.wordpress.com/2014/10/micro-authentication.png
Meaning that i'll have a web application that's running on some nodeJS server, and i'll have this project on a different server that should take care of user authentications (and later on services)
So how will it work? Say i'm going into my site for the first time. Obviously i dont have an access token (as a user). So i click on the login button. Now there are 2 options:
Once i enter that info, a grant_type=password request will be send with a client_id and client_secret of the nodejs server that the web application runs on
It will ask me to enter a username and password triggering grant_type=password request that will get me the access_token and send the response_type=code request again (?!) and continue with grant_type=authorization_code to get the access token that i already have?!
Option 2 seems to be impossible and incorrect but then i dont see when i will need to use the response_type=code request.
I might be totally off in my thinking and i will really be glad if someone could straighten things up for me.
The text was updated successfully, but these errors were encountered: