Skip to content

Commit e81d160

Browse files
committed
relying_party_name is depreciated
1 parent 5231790 commit e81d160

4 files changed

Lines changed: 15 additions & 21 deletions

File tree

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,8 @@ The package automatically registers the following routes:
8484
// config/passkeys.php
8585

8686
return [
87-
// Relying Party (defaults to APP_URL host and app name)
88-
'relying_party' => [
89-
'id' => parse_url(config('app.url'), PHP_URL_HOST),
90-
'name' => config('app.name'),
91-
],
87+
// Relying Party ID (defaults to APP_URL host)
88+
'relying_party_id' => parse_url(config('app.url'), PHP_URL_HOST),
9289

9390
// WebAuthn timeout in milliseconds
9491
'timeout' => 60000,

config/passkeys.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,16 @@
44

55
/*
66
|--------------------------------------------------------------------------
7-
| Relying Party
7+
| Relying Party ID
88
|--------------------------------------------------------------------------
99
|
10-
| The relying party represents your application in the WebAuthn protocol.
11-
| The ID is typically your domain (e.g., "example.com"). Passkeys are
12-
| bound to this ID and can only be verified on matching domains.
10+
| The relying party ID represents your application in the WebAuthn protocol.
11+
| This is typically your domain (e.g., "example.com"). Passkeys are bound
12+
| to this ID and can only be verified on matching domains.
1313
|
1414
*/
1515

16-
'relying_party' => [
17-
'id' => parse_url(config('app.url'), PHP_URL_HOST),
18-
'name' => config('app.name'),
19-
],
16+
'relying_party_id' => parse_url(config('app.url'), PHP_URL_HOST),
2017

2118
/*
2219
|--------------------------------------------------------------------------

src/Passkeys.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,20 @@ class Passkeys
3535
*/
3636
public static function relyingPartyId(): string
3737
{
38-
$rpId = Config::string('passkeys.relying_party.id');
39-
40-
return $rpId;
38+
return Config::string('passkeys.relying_party_id');
4139
}
4240

4341
/**
4442
* Get the relying party name.
43+
*
44+
* The RP name is deprecated in the WebAuthn spec as most clients don't display it,
45+
* but remains required for backwards compatibility. Defaults to the RP ID.
46+
*
47+
* @see https://www.w3.org/TR/webauthn-3/#dom-publickeycredentialentity-name
4548
*/
4649
public static function relyingPartyName(): string
4750
{
48-
$name = Config::string('passkeys.relying_party.name');
49-
50-
return $name;
51+
return static::relyingPartyId();
5152
}
5253

5354
/**

tests/TestCase.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ protected function defineEnvironment($app): void
2929
'database' => ':memory:',
3030
]);
3131

32-
$app['config']->set('passkeys.relying_party.id', 'localhost');
33-
$app['config']->set('passkeys.relying_party.name', 'Test App');
32+
$app['config']->set('passkeys.relying_party_id', 'localhost');
3433
$app['config']->set('auth.providers.users.model', User::class);
3534

3635
Passkeys::useUserModel(User::class);

0 commit comments

Comments
 (0)