oAuthTokens
##DB Models:
- User — user has name and password;
- Client - client that is granted access on behalf of the user. Have name and secret code.
- AccessToken — token (type of bearer) issued to the client is limited in time.
- RefreshToken - allows you to request a new bearer-token without re-query the user for the password.
##Run
- npm i
- change default values for record in database
- node gen.js
- node app.js
##HTTP req
- http POST get tokens
http://localhost:8080/oauth/token + { grant_type=password, client_id=clientId, client_secret=clientSecret, username=user, password=password }
- http POST refresh
http://localhost:8080/oauth/token + { grant_type=refresh_token, client_id=clientId, client_secret=clientSecret, refresh_token=Token }