Skip to content

Commit d8f2a50

Browse files
committed
added config authentication
Signed-off-by: bidi47 <bidi@apidemia.com>
1 parent faecae4 commit d8f2a50

2 files changed

Lines changed: 34 additions & 19 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
return [
6+
'authentication' => [
7+
'private_key' => [
8+
'key_or_path' => realpath(__DIR__ . '/../../data/oauth/private.key'),
9+
'key_permissions_check' => false,
10+
],
11+
'public_key' => [
12+
'key_or_path' => realpath(__DIR__ . '/../../data/oauth/public.key'),
13+
'key_permissions_check' => false,
14+
],
15+
'encryption_key' => require realpath(__DIR__ . '/../../data/oauth/encryption.key'),
16+
17+
//Period interval formatting:
18+
//P period (used with D days, W weeks, M months, Y years) or PT (used with H hours, M minutes, S seconds)
19+
//a number precedes each unit, e.g. P2D, PT10M
20+
21+
//Usage examples:
22+
//P1M is 1 calendar month - for exactly 30 days use P30D
23+
//P2DT3H is 2 days + 3 hours
24+
//PT3600S is 3600 seconds
25+
'access_token_expire' => 'P1D', //1 day
26+
'refresh_token_expire' => 'P1M', //1 calendar month
27+
'auth_code_expire' => 'PT10M', //10 minutes
28+
'invalid_credentials' => [
29+
'error' => 'Invalid credentials.',
30+
'error_description' => 'Invalid credentials.',
31+
'message' => 'Invalid credentials.',
32+
],
33+
],
34+
];

‎config/autoload/local.php.dist‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,6 @@ return [
4545
'openapi' => [
4646
'server_description' => 'Development server',
4747
],
48-
'authentication' => [
49-
'private_key' => [
50-
'key_or_path' => realpath(__DIR__ . '/../../data/oauth/private.key'),
51-
'key_permissions_check' => false,
52-
],
53-
'public_key' => [
54-
'key_or_path' => realpath(__DIR__ . '/../../data/oauth/public.key'),
55-
'key_permissions_check' => false,
56-
],
57-
'encryption_key' => require realpath(__DIR__ . '/../../data/oauth/encryption.key'),
58-
'access_token_expire' => 'P1D',
59-
'refresh_token_expire' => 'P1M',
60-
'auth_code_expire' => 'PT10M',
61-
'invalid_credentials' => [
62-
'error' => 'Invalid credentials.',
63-
'error_description' => 'Invalid credentials.',
64-
'message' => 'Invalid credentials.',
65-
],
66-
],
6748
'databases' => $databases,
6849
'doctrine' => [
6950
'connection' => [

0 commit comments

Comments
 (0)