-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.default.js
32 lines (30 loc) · 1.06 KB
/
config.default.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
'use strict';
const OAuth2Server = require('oauth2-server');
/**
* **egg-oauth config**
*
* @see https://oauth2-server.readthedocs.io
* @member Config#oauth
* @property {Object} OAuth2Server class OAuth2Server
* @property {String | Object} model OAuth2Server model Object or path
* @property {Boolean} allowBearerTokensInQueryString see docs
* @property {Number} accessTokenLifetime see docs
* @property {Number} refreshTokenLifetime see docs
*/
exports.oauth = {
default: {
OAuth2Server, // change version to fit your app
model: './app/extend/oauth', // relative path from app.baseDir
allowBearerTokensInQueryString: true, // querystring params: access_token
accessTokenLifetime: 3600, // 1 hours
refreshTokenLifetime: 1209600, // 2 weeks
// authorizationCodeLifetime: 300, // 5 minutes
// allowEmptyState: false, // state required
// defaultScopes: 'default', // multiple split with space
// requireClientAuthentication: {
// password: false,
// authorization_code: false,
// refresh_token: false,
// },
},
};