Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

๐Ÿ”‘ Example of an Authentication Server of OAuth2 in nodejs.

Notifications You must be signed in to change notification settings

afska/node-oauth2-server-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

25 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

oauth2-server-example

npm install -g coffee-script
npm install

coffee src/seed.coffee # creates the test user and app
npm start # runs the server

Example using the password and authorization_code grant types

You go to /...

1

...the secret room is locked...

2

...but if you configure Basic Auth with the clientId and clientSecret...

3

...and do an OAuth2 request...

4

...all is fine ๐Ÿ˜ƒ...

5

...and the doors will be opened.

6

Maybe you want to authorize the application...

7

...probably, a code will be generated.

8

You can exchange that code by a token! act quickly, as it expires!

9

http://localhost:3000/oauth/authorise?response_type=code&client_id=capi2231&redirect_uri=http://capituchi.com/auth/lepocamon/redirect