A login service, built on top of hharnisc/auth and hharnisc/user.
NOTE: this is a work in progress
Install docker beta
Do a local deploy
./local_deploy.sh
Install docker toolbox (for CI tests)
$ cd service
Install dependencies
$ npm install
$ npm run test
$ npm run test:jest
$ npm run test:watch
$ npm run test:integration
$ cd service
Install dependencies
$ npm install
Start the server
$ npm start
Follow Quickstart instructions
./local_deploy.sh -d
./local_deploy.sh -n
./local_deploy.sh -dn
TODO
{
"id": "1",
"email": "someone@xyz.com",
"emails": ["someoneelse@xyz.com", "someone@xyz.com"],
"providers": {
"google": {
/* google provider data*/
}
},
"roles": ["read", "write", "sudo"]
}
{
"accessToken": "some.access.token",
"refreshToken": "some.refreshToken",
"expireTime": 1465994137309
}
A health check
No parameters
200 - Empty
Login a user. Creates or updates a user (keyed off of email address) and returns the full user object with a session token to make requests against internal apis.
- email - email address* - the user's email address
- provider - string - the source where the user was authenticated
- providerInfo - object - any metadata to store from the source
- roles - [string] - a list of roles associated with the user
Note roles are only set on the first time the user is seen
- user - object - complete user object see User Object
- token - object - auth token see Auth Token
Logout a user. Rejects the refresh token for a user so it can't be used to create new access tokens.
- userId - email address* - user id
- refreshToken - string - persistent token used to generate an
accessToken
200 - Empty