1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- 'use strict'
- /** @type {import('@adonisjs/framework/src/Env')} */
- const Env = use('Env')
- module.exports = {
- /*
- |--------------------------------------------------------------------------
- | Authenticator
- |--------------------------------------------------------------------------
- |
- | Authentication is a combination of serializer and scheme with extra
- | config to define on how to authenticate a user.
- |
- | Available Schemes - basic, session, jwt, api
- | Available Serializers - lucid, database
- |
- */
- authenticator: 'session',
- /*
- |--------------------------------------------------------------------------
- | Session
- |--------------------------------------------------------------------------
- |
- | Session authenticator makes use of sessions to authenticate a user.
- | Session authentication is always persistent.
- |
- */
- session: {
- serializer: 'lucid',
- model: 'App/Models/User',
- scheme: 'session',
- uid: 'username',
- password: 'password'
- },
- /*
- |--------------------------------------------------------------------------
- | Basic Auth
- |--------------------------------------------------------------------------
- |
- | The basic auth authenticator uses basic auth header to authenticate a
- | user.
- |
- | NOTE:
- | This scheme is not persistent and users are supposed to pass
- | login credentials on each request.
- |
- */
- basic: {
- serializer: 'lucid',
- model: 'App/Models/User',
- scheme: 'basic',
- uid: 'username',
- password: 'password'
- },
- /*
- |--------------------------------------------------------------------------
- | Jwt
- |--------------------------------------------------------------------------
- |
- | The jwt authenticator works by passing a jwt token on each HTTP request
- | via HTTP `Authorization` header.
- |
- */
- jwt: {
- serializer: 'lucid',
- model: 'App/Models/User',
- scheme: 'jwt',
- uid: 'username',
- password: 'password',
- options: {
- secret: Env.get('APP_KEY')
- }
- },
- /*
- |--------------------------------------------------------------------------
- | Api
- |--------------------------------------------------------------------------
- |
- | The Api scheme makes use of API personal tokens to authenticate a user.
- |
- */
- api: {
- serializer: 'lucid',
- model: 'App/Models/User',
- scheme: 'api',
- uid: 'username',
- password: 'password'
- }
- }
|