Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wejs/we-passport-oauth2-password
We.js Passport oauth2 password grant strategy plugin
https://github.com/wejs/we-passport-oauth2-password
Last synced: about 1 month ago
JSON representation
We.js Passport oauth2 password grant strategy plugin
- Host: GitHub
- URL: https://github.com/wejs/we-passport-oauth2-password
- Owner: wejs
- Created: 2016-10-08T23:04:39.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T05:10:47.000Z (almost 2 years ago)
- Last Synced: 2024-04-23T19:38:31.735Z (8 months ago)
- Language: JavaScript
- Size: 576 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# We.js Passport oauth2 password grant strategy plugin
This plugin adds suport for local authentication with password grant type in we.js projects.
The client credentials grant type provides an application a way to access its own service account. Examples of when this might be useful include if an application wants to update its registered description or redirect URI, or access other data stored in its service account via the API.
Compatible with: https://ember-simple-auth.com client
## Installation
```sh
we i we-passport-oauth2-password
```## Urls:
### Authenticate
#### POST /auth/grant-password/authenticateBody params:
- grant_type=password
- username
- passwordResponse example:
```JSON
{
token_type: 'passportGrantToken',
access_token: 'tokenString',
expires_in: 12313, // milisecconds of token life
// refresh_token: '', // TODO!
user: req.user // user object
}
```## Configuration
With configuration files:
```
// ...
'oauth2-password-grant': {
storage: 'sequelize', // sequelize || redis
redis: {
host: null,
port: null,
password: null
// see https://github.com/NodeRedis/node_redis#rediscreateclient for all options
}
},passport: {
strategies: {
// session
'oauth2-password-grant': {
expires_in: 1800, // secconds
}
}
}
// ...
```## ROADMAP
- Add revoke token url
- Add delete invalid tokens every time## Links
- We.js site: http://wejs.org
- Resource Owner Password Credentials Grant SPEC: https://tools.ietf.org/html/rfc6749#section-4.3## Copyright and license
Copyright Alberto Souza and contributors , under [the MIT license](https://github.com/wejs/we-core/blob/master/LICENSE.md).
## Sponsored by
- Linky: http://linkysystems.com