Update README.md

This commit is contained in:
Julien Le Coupanec
2018-02-11 19:12:10 +01:00
parent 945738c992
commit dca4f0d99a
2 changed files with 29 additions and 2 deletions

View File

@@ -298,6 +298,33 @@ npm install @feathersjs/authentication-oauth1 --save
npm install @feathersjs/authentication-oauth2 --save
```
app.configure(auth(options)) // configure the authentication plugin with the given options
options = {
path: '/authentication', // the authentication service path
header: 'Authorization', // the header to use when using JWT auth
entity: 'user', // the entity that will be added to the request, socket, and context.params. (ie. req.user, socket.user, context.params.user)
service: 'users', // the service to look up the entity
passReqToCallback: true, // whether the request object should be passed to the strategies `verify` function
session: false, // whether to use sessions
cookie: {
enabled: false, // whether cookie creation is enabled
name: 'feathers-jwt', // the cookie name
httpOnly: false, // when enabled, prevents the client from reading the cookie.
secure: true // whether cookies should only be available over HTTPS
},
jwt: {
header: { typ: 'access' }, // by default is an access token but can be any type
audience: 'https://yourdomain.com', // The resource server where the token is processed
subject: 'anonymous', // Typically the entity id associated with the JWT
issuer: 'feathers', // The issuing server, application or resource
algorithm: 'HS256', // the algorithm to use
expiresIn: '1d' // the access token expiry
}
}
app.service('authentication') //
/* *******************************************************************************************
* 5. DATABASE: Feathers common database adapter API and querying mechanism.