Skip to content

Commit 8c57398

Browse files
committed
change the name of the identifying attribute parameter
1 parent 17db846 commit 8c57398

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ ALTER TABLE credentials ADD COLUMN `hashedId` VARCHAR(100) DEFAULT '---' AFTER `
3535
The updated schema is compatible with the 0.11.x releases, so a roll-back to an
3636
older version is still possible without removing the column.
3737

38+
Also note that the parameter attribute_username was changed to identifyingAttribute
39+
to achieve better consistency with other authproc filters.
40+
3841
How to setup the webauthn module as an authprocfilter
3942
-----------------------------------------------------
4043
You need to enable the module's authprocfilter at a priority level

config-templates/module_webauthn.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
'database.password' => 'sdfsdf',
1313
],
1414

15-
'attrib_username' => 'urn:oid:1.3.6.1.4.1.23735.100.0',
15+
'identifyingAttribute' => 'uid',
1616
'attrib_displayname' => 'urn:oid:2.5.4.3',
1717

1818
/* FIDO2 is phishing-resistent by binding generated credentials to a scope.

src/Controller/Registration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function main(/** @scrutinizer ignore-unused */ Request $request): Runnab
139139
if ($hostname !== null) {
140140
$stateData->derivedScope = $hostname;
141141
}
142-
$stateData->usernameAttrib = $moduleConfig->getString('attrib_username');
142+
$stateData->usernameAttrib = $moduleConfig->getString('identifyingAttribute');
143143
$stateData->displaynameAttrib = $moduleConfig->getString('attrib_displayname');
144144

145145
StaticProcessHelper::prepareState($stateData, $state);

src/Controller/WebAuthn.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ public static function loadModuleConfig($moduleConfig, &$stateData): void {
131131
$stateData->derivedScope = $hostname;
132132
}
133133

134-
if (array_key_exists('attrib_username', $moduleConfig)) {
135-
$stateData->usernameAttrib = $moduleConfig['attrib_username'];
134+
if (array_key_exists('identifyingAttribute', $moduleConfig)) {
135+
$stateData->usernameAttrib = $moduleConfig['identifyingAttribute'];
136136
} else {
137-
throw new Error\CriticalConfigurationError('webauthn: it is required to set attrib_username in config.');
137+
throw new Error\CriticalConfigurationError('webauthn: it is required to set identifyingAttribute in config.');
138138
}
139139

140140
if (array_key_exists('attrib_displayname', $moduleConfig)) {

tests/src/Controller/RegistrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected function setUp(): void
5353
Configuration::setPreLoadedConfig(
5454
Configuration::loadFromArray(
5555
[
56-
'attrib_username' => 'uid',
56+
'identifyingAttribute' => 'uid',
5757
'attrib_displayname' => 'displayName',
5858
'store' => [
5959
'webauthn:Database',

0 commit comments

Comments
 (0)