Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 1.18 KB

README.md

File metadata and controls

42 lines (31 loc) · 1.18 KB

OAuth2orize app example

This app is an example to demonstrate how to make a simple oauth2 server provider with OAuth2orize.

Installing (unix like way)

    $ mkdir ~/projects
    $ cd ~/projects
    $ git clone [email protected]:joaoneto/oauth2orize-example.git
    $ cd oauth2orize-example
    $ npm install

DB setup

Create a user:

» use oauth2orize
» db.users.insert({name: "Foo Bar", "email": "[email protected]", password: "123"})
» db.users.find()
{ "_id" : ObjectId("XXXXXXXXXXXXXXXXXXXXXXXX"), "name" : "Foo Bar", "email" : "[email protected]", "password" : "123" }

Create a client:

» db.clients.insert({user_id: ObjectId("XXXXXXXXXXXXXXXXXXXXXXXX"), secret:"abc123", redirect_uri:"http://localhost:3000"})

Edit client_oauth.sh (gist)

Change CLIENT_ID="XXXXXXXXXXXXXXXXXXXXXXXX", replace X with your client_id.

Init app

    $ node server

Test

    $ ./client_oauth.sh

License

The MIT License