Skip to content

joaoneto/oauth2orize-example

Repository files navigation

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 git@github.com:joaoneto/oauth2orize-example.git
    $ cd oauth2orize-example
    $ npm install

DB setup

Create a user:

» use oauth2orize
» db.users.insert({name: "Foo Bar", "email": "foo@example.com", password: "123"})
» db.users.find()
{ "_id" : ObjectId("XXXXXXXXXXXXXXXXXXXXXXXX"), "name" : "Foo Bar", "email" : "foo@example.com", "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

About

Oauth2 server example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published