1 | <?php |
||
35 | class Module extends BaseModule implements BootstrapInterface |
||
36 | { |
||
37 | /** |
||
38 | * @var string backend to use, available backends are 'redis' |
||
39 | */ |
||
40 | public $backend; |
||
41 | |||
42 | /** |
||
43 | * @var Connection|array|string the DB connection object or the application component ID of the DB connection. |
||
44 | */ |
||
45 | public $db; |
||
46 | /** |
||
47 | * This user class will be used to link oauth2 authorization system with the application. |
||
48 | * The class must implement \sweelix\oauth2\server\interfaces\UserInterface |
||
49 | * If not defined, the Yii::$app->user->identityClass value will be used |
||
50 | * @var string|array user class definition. |
||
51 | */ |
||
52 | public $identityClass; |
||
53 | |||
54 | /** |
||
55 | * @var string change base end point |
||
56 | */ |
||
57 | public $baseEndPoint = ''; |
||
58 | |||
59 | /** |
||
60 | * @var bool configure oauth server (use_jwt_access_tokens) |
||
61 | */ |
||
62 | public $allowJwtAccesToken = false; |
||
63 | |||
64 | /** |
||
65 | * @var array configure oauth server (allowed_algorithms) |
||
66 | */ |
||
67 | public $allowAlgorithm = ['RS256', 'RS384', 'RS512']; |
||
68 | |||
69 | /** |
||
70 | * @var string|array jwt audience. Default to token endpoint |
||
71 | */ |
||
72 | public $jwtAudience = ['token/index']; |
||
73 | |||
74 | /** |
||
75 | * @var bool configure oauth server (store_encrypted_token_string) |
||
76 | */ |
||
77 | public $storeEncryptedTokenString = true; |
||
78 | |||
79 | /** |
||
80 | * @var bool configure oauth server (use_openid_connect) |
||
81 | */ |
||
82 | public $allowOpenIdConnect = false; |
||
83 | |||
84 | /** |
||
85 | * @var int configure oauth server (id_lifetime) |
||
86 | */ |
||
87 | public $idTTL = 3600; |
||
88 | |||
89 | /** |
||
90 | * @var int configure oauth server (access_lifetime) |
||
91 | */ |
||
92 | public $accessTokenTTL = 3600; |
||
93 | |||
94 | /** |
||
95 | * @var int configure oauth server (refresh_token_lifetime) |
||
96 | */ |
||
97 | public $refreshTokenTTL = 1209600; |
||
98 | |||
99 | /** |
||
100 | * @var string configure oauth server (www_realm) |
||
101 | */ |
||
102 | public $realm = 'Service'; |
||
103 | |||
104 | /** |
||
105 | * @var string configure oauth server (token_param_name) |
||
106 | */ |
||
107 | public $tokenQueryName = 'access_token'; |
||
108 | |||
109 | /** |
||
110 | * @var string configure oauth server (token_bearer_header_name) |
||
111 | */ |
||
112 | public $tokenBearerName = 'Bearer'; |
||
113 | |||
114 | /** |
||
115 | * @var bool configure oauth server (enforce_state) |
||
116 | */ |
||
117 | public $enforceState = true; |
||
118 | |||
119 | /** |
||
120 | * @var bool configure oauth server (require_exact_redirect_uri) |
||
121 | */ |
||
122 | public $allowOnlyRedirectUri = true; |
||
123 | |||
124 | /** |
||
125 | * @var bool configure oauth server (allow_implicit) |
||
126 | */ |
||
127 | public $allowImplicit = false; |
||
128 | |||
129 | /** |
||
130 | * @var bool allow authorization code grant |
||
131 | */ |
||
132 | public $allowAuthorizationCode = true; |
||
133 | |||
134 | /** |
||
135 | * @var bool allow client credentials grant |
||
136 | */ |
||
137 | public $allowClientCredentials = true; |
||
138 | |||
139 | /** |
||
140 | * @var bool allow password grant |
||
141 | */ |
||
142 | public $allowPassword = true; |
||
143 | |||
144 | /** |
||
145 | * @var bool configure oauth server (allow_credentials_in_request_body) |
||
146 | */ |
||
147 | public $allowCredentialsInRequestBody = true; |
||
148 | |||
149 | /** |
||
150 | * @var bool configure oauth server (allow_public_clients) |
||
151 | */ |
||
152 | public $allowPublicClients = true; |
||
153 | |||
154 | /** |
||
155 | * @var bool configure oauth server (always_issue_new_refresh_token) |
||
156 | */ |
||
157 | public $alwaysIssueNewRefreshToken = true; |
||
158 | |||
159 | /** |
||
160 | * @var bool configure oauth server (unset_refresh_token_after_use) |
||
161 | */ |
||
162 | public $unsetRefreshTokenAfterUse = false; |
||
163 | |||
164 | /** |
||
165 | * @var int duration of login time for multiple authorize calls |
||
166 | */ |
||
167 | public $loginDuration = 60 * 60 * 24 * 30; |
||
168 | /** |
||
169 | * @inheritdoc |
||
170 | */ |
||
171 | 45 | public function init() |
|
175 | |||
176 | /** |
||
177 | * Load dataservices in container |
||
178 | * @param \yii\base\Application $app |
||
179 | * @since XXX |
||
180 | */ |
||
181 | 45 | protected function setUpDi($app) |
|
219 | |||
220 | /** |
||
221 | * @inheritdoc |
||
222 | */ |
||
223 | 45 | public function bootstrap($app) |
|
246 | |||
247 | /** |
||
248 | * Update controllers map to add console commands |
||
249 | * @param ConsoleApplication $app |
||
250 | * @since XXX |
||
251 | */ |
||
252 | 34 | protected function mapConsoleControllers(ConsoleApplication $app) |
|
265 | } |
||
266 |