You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You don't need to add this package to your service providers.
22
37
23
-
## Support
24
-
25
-
This package supports Laravel 5.8 and newer, and has been tested with php 7.2 and newer versions.
26
-
27
-
It's based on [web-auth/webauthn-framework](https://github.com/web-auth/webauthn-framework).
28
-
29
-
30
-
## Important
31
-
32
-
Your browser will refuse to negotiate a relay to your security device without the following:
33
-
34
-
- domain (localhost and 127.0.0.1 will be rejected by `webauthn.js`)
35
-
- an SSL/TLS certificate trusted by your browser (self-signed is okay)
36
-
- connected HTTPS on port 443 (ports other than 443 will be rejected)
37
-
38
-
### Homestead
39
-
If you are a Laravel Homestead user, the default is to forward ports. You can switch from NAT/port forwarding to a private network with similar `Homestead.yaml` options:
40
-
41
-
```yaml
42
-
sites:
43
-
- map: homestead.test
44
-
networks:
45
-
- type: "private_network"
46
-
ip: "192.168.254.2"
47
-
```
48
-
49
-
Re-provisioning vagrant will inform your virtual machine of the new network and install self-signed SSL/TLS certificates automatically: `vagrant reload --provision`
50
-
51
-
If you haven't done so already, describe your site domain and network in your hosts file:
52
-
```
53
-
192.168.254.2 homestead.test
54
-
```
55
-
56
38
57
39
## Configuration
58
40
59
41
You can publish the LaravelWebauthn configuration in a file named `config/webauthn.php`, and resources.
This way users would have to validate their key on login.
88
70
89
71
72
+
### Login via remember
73
+
74
+
When session expires, but the user set the `remember` token, you can revalidate webauthn session by adding this in your `App\Providers\EventServiceProvider` file:
75
+
76
+
```php
77
+
use Illuminate\Auth\Events\Login;
78
+
use LaravelWebauthn\Listeners\LoginViaRemember;
79
+
80
+
class EventServiceProvider extends ServiceProvider
81
+
{
82
+
protected $listen = [
83
+
Login::class => [
84
+
LoginViaRemember::class,
85
+
],
86
+
];
87
+
...
88
+
```
90
89
91
90
# Usage
92
91
@@ -184,35 +183,120 @@ If `postSuccessRedirectRoute` is empty, the return will be JSON form:
184
183
}
185
184
```
186
185
186
+
## Important
187
+
188
+
Your browser will refuse to negotiate a relay to your security device without the following:
189
+
190
+
- domain (localhost and 127.0.0.1 will be rejected by `webauthn.js`)
191
+
- an SSL/TLS certificate trusted by your browser (self-signed is okay)
192
+
- connected HTTPS on port 443 (ports other than 443 will be rejected)
193
+
194
+
### Homestead
195
+
If you are a Laravel Homestead user, the default is to forward ports. You can switch from NAT/port forwarding to a private network with similar `Homestead.yaml` options:
196
+
197
+
```yaml
198
+
sites:
199
+
- map: homestead.test
200
+
networks:
201
+
- type: "private_network"
202
+
ip: "192.168.254.2"
203
+
```
204
+
205
+
Re-provisioning vagrant will inform your virtual machine of the new network and install self-signed SSL/TLS certificates automatically: `vagrant reload --provision`
206
+
207
+
If you haven't done so already, describe your site domain and network in your hosts file:
208
+
```
209
+
192.168.254.2 homestead.test
210
+
```
187
211
188
-
## Urls
189
212
190
-
These url are used
213
+
## Routes
214
+
215
+
These reoutes are defined:
191
216
192
217
* GET `/webauthn/auth` / `route('webauthn.login')`
193
218
The login page.
194
219
195
220
* POST `/webauthn/auth` / `route('webauthn.auth')`
196
221
Post datas after a WebAuthn login validate.
197
222
198
-
* GET `/webauthn/register` / `route('webauthn.register')`
223
+
* GET `/webauthn/keys/create` / `route('webauthn.create')`
199
224
Get datas to register a new key
200
225
201
-
* POST `/webauthn/register` / `route('webauthn.create')`
226
+
* POST `/webauthn/keys` / `route('webauthn.store')`
0 commit comments