oneblink / hapi-oauth2orize

A bridge between hapi and OAuth2orize
BSD 3-Clause "New" or "Revised" License
27 stars 17 forks source link

Help needed regarding implementation of resource owner password grant. #15

Open lutfor3737 opened 8 years ago

lutfor3737 commented 8 years ago

I am using hapi-ouath2orize wrapper in my Hapi API. In my application, i need to implement resource owner password grant. So far i understand i have to use following curl command to implement this grant.

  1. curl -XPOST "http://localhost:3000/oauth/token" -d "grant_type=password&client_id=abc123&client_secret=ssh-secret&username=bob&password=secret" return: TOKEN
  2. curl -H 'Authorization: Bearer TOKEN' -GET "http://localhost:3000/api/userinfo" can access protected resource using this command.

can anyone help me what will flow with some guidance(some sample code will be appreciable) ?