afska / node-oauth2-server-example

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

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


Languages

Language:CoffeeScript 89.2%Language:HTML 10.1%Language:JavaScript 0.6%