This repository has been archived by the owner on Apr 17, 2018. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(config:auth): add configuration file for auth
- Loading branch information
1 parent
857ab8d
commit 8198ef4
Showing
1 changed file
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
'use strict' | ||
|
||
module.exports = { | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Authenticator | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Authenticator is a combination of HTTP Authentication scheme and the | ||
| serializer to be used for retrieving users. Below is the default | ||
| authenticator to be used for every request. | ||
| | ||
| Available Schemes - basic, session, jwt, api | ||
| Available Serializers - Lucid, Database | ||
| | ||
*/ | ||
authenticator: 'session', | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Session Authenticator | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Session authenticator will make use of sessions to maintain the login | ||
| state for a given user. | ||
| | ||
*/ | ||
session: { | ||
serializer: 'Lucid', | ||
model: 'App/Model/User', | ||
scheme: 'session', | ||
uid: 'email', | ||
password: 'password' | ||
}, | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Basic Auth Authenticator | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Basic Authentication works on Http Basic auth header. | ||
| | ||
*/ | ||
basicAuth: { | ||
serializer: 'Lucid', | ||
model: 'App/Model/User', | ||
scheme: 'basic', | ||
uid: 'email', | ||
password: 'password' | ||
}, | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| JWT Authenticator | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Jwt authentication works with a payload sent with every request under | ||
| Http Authorization header. | ||
| | ||
*/ | ||
jwt: { | ||
serializer: 'Lucid', | ||
model: 'App/Model/User', | ||
scheme: 'jwt', | ||
secret: '@ref=app.appKey' | ||
}, | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| API Authenticator | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Api authenticator authenticates are requests based on Authorization | ||
| header. | ||
| | ||
| Make sure to define relationships on User and Token model as defined | ||
| in documentation | ||
| | ||
*/ | ||
api: { | ||
serializer: 'Lucid', | ||
model: 'App/Model/Token', | ||
scheme: 'api' | ||
} | ||
|
||
} |