There're two branches in this repository. One is Application, another one is API. You need both server to use this project.
This is the Resource Server that has OAuth 2.0 APIs.
- Clone this branch
git clone -b api https://github.com/ninanung/3-legged-oauth.git
- Move and start server
cd 3-legged-oauth/server
npm start
- API Server will start in
http://localhost:3002
This is the Client that make connection from User(Resource Owner) to Resource Server.
- Clone this branch
git clone -b application https://github.com/ninanung/3-legged-oauth.git
- Move and start server
cd 3-legged-oauth/server
npm start
- Application Server will start in
http://localhost:3001
This is the Frontend Server that render React SPA web page.
- Clone this branch
git clone -b frontend https://github.com/ninanung/3-legged-oauth.git
- Move and start server
cd 3-legged-oauth/server
npm start
- Frontend Server will start in
http://localhost:3000
-
Connect to
http://localhost:3001/login
-
Click the button "Login with Sample Service".
-
It will redirect you to
http://localhost:3002/api/auth/app
(api server) and if you didn't login to service, redirect you tohttp://localhost:3000/login
again. -
Please Login.
-
Allow the app to use your account data.
-
Now you authorized and client server got token.
-
Client server will show your email data when you login to client page.