This repository has been archived by the owner on Feb 17, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
laraguard.php
133 lines (116 loc) · 4.44 KB
/
laraguard.php
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?php
return [
/*
|--------------------------------------------------------------------------
| TwoFactorAuthentication Model
|--------------------------------------------------------------------------
|
| When using the "TwoFactorAuthentication" trait from this package, we need
| to know which Eloquent model should be used to retrieve your two factor
| authentication records. You can use your own for more advanced logic.
|
*/
'model' => \DarkGhostHunter\Laraguard\Eloquent\TwoFactorAuthentication::class,
/*
|--------------------------------------------------------------------------
| Cache Store
|--------------------------------------------------------------------------
|
| Codes can only be used one time, so we will hold them in the cache for
| the period it shouldn't be used again. You can customize the default
| cache store to use. Using "null" will use the default cache store.
|
*/
'cache' => [
'store' => null,
'prefix' => '2fa.code',
],
/*
|--------------------------------------------------------------------------
| Recovery Codes
|--------------------------------------------------------------------------
|
| This option controls the recovery codes generation. By default is enabled
| so users have a way to authenticate without a code generator. The length
| of the codes, as their quantity, can be configured to tighten security.
|
*/
'recovery' => [
'enabled' => true,
'codes' => 10,
'length' => 8,
],
/*
|--------------------------------------------------------------------------
| Safe Devices
|--------------------------------------------------------------------------
|
| Authenticating with Two Factor Codes can become very obnoxious when the
| user does it every time. To "remember" a device where a 2FA code was
| validated to not ask again you can enable Safe Device to save it.
|
*/
'safe_devices' => [
'cookie' => '2fa_remember',
'enabled' => false,
'max_devices' => 3,
'expiration_days' => 14,
],
/*
|--------------------------------------------------------------------------
| Require Two Factor Middleware
|--------------------------------------------------------------------------
|
| When using the "2fa.confirm" middleware a view with a form will be used
| to ask the user for a TOTP code, an a controller action to receive it.
| You can change both actions and also when to forget the confirmation.
|
*/
'confirm' => [
'timeout' => 10800, // 3 hours
'view' => 'DarkGhostHunter\Laraguard\Http\Controllers\Confirm2FACodeController@showConfirmForm',
'action' => 'DarkGhostHunter\Laraguard\Http\Controllers\Confirm2FACodeController@confirm'
],
/*
|--------------------------------------------------------------------------
| Secret Length
|--------------------------------------------------------------------------
|
| The package uses a shared secret length of 160-bit, as recommended by the
| RFC 4226. This makes it compatible with most 2FA apps. You can change it
| freely but consider the standard allows shared secrets down to 128-bit.
|
*/
'secret_length' => 20,
/*
|--------------------------------------------------------------------------
| TOTP config
|--------------------------------------------------------------------------
|
| While this package uses recommended RFC 4226 and RDC 6238 settings, you
| can further configure how TOTP should work. These settings are saved
| for each 2FA authentication, so it will only affect new accounts.
|
*/
'issuer' => env('OTP_TOTP_ISSUER'),
'totp' => [
'digits' => 6,
'seconds' => 30,
'window' => 1,
'algorithm' => 'sha1',
],
/*
|--------------------------------------------------------------------------
| QR Code Config
|--------------------------------------------------------------------------
|
| This package uses the BaconQrCode generator package to generate QR codes
| as SVG. These size and image margin values are used to create them. You
| can always your own code to create personalized QR Codes from the URI.
|
*/
'qr_code' => [
'size' => 400,
'margin' => 4,
],
];