Skip to content

Commit

Permalink
Merge pull request #74 from silinternational/feature/label-webauthn-o…
Browse files Browse the repository at this point in the history
…n-verify

allow a label/name to be added to a call to verify a new webauthn
  • Loading branch information
Baggerone authored Feb 24, 2023
2 parents e2888e9 + e787964 commit b33602a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions features/request/RequestContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ public function iCallMfaVerifyRegistration()
$this->requestData['value'],
$this->rpOrigin,
'registration',
$this->requestData['label'],
);
}
}
4 changes: 3 additions & 1 deletion features/request/request.feature
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ Feature: Formatting requests for sending to the ID Broker API
And I provide an "id" of "789"
And I provide an "employee_id" of "123"
And I provide a "value" of "01234987"
And I provide a "label" of "Yubikey"
When I call mfaVerifyRegistration
Then the method should be "POST"
And the url should be 'https://api.example.com/mfa/789/verify/registration?rpOrigin=https%3A%2F%2Flogin.example.com'
Expand All @@ -438,6 +439,7 @@ Feature: Formatting requests for sending to the ID Broker API
"""
{
"employee_id": "123",
"value": "01234987"
"value": "01234987",
"label": "Yubikey"
}
"""
13 changes: 11 additions & 2 deletions src/IdBrokerClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,14 @@ public function mfaUpdateWebauthn(string $id, string $employeeId, string $label,
* @throws MfaRateLimitException
* @throws ServiceException
*/
public function mfaVerify(string $id, string $employeeId, $value, string $rpOrigin = '', string $type = '')
{
public function mfaVerify(
string $id,
string $employeeId,
$value,
string $rpOrigin = '',
string $type = '',
string $label = ''
) {
$config = [
'id' => $id,
'employee_id' => $employeeId,
Expand All @@ -471,6 +477,9 @@ public function mfaVerify(string $id, string $employeeId, $value, string $rpOrig
];

if ($type != '') {
if ( !empty($label)) {
$config['label'] = $label;
}
$result = $this->mfaVerifyRegistrationInternal($config);
} else {
$result = $this->mfaVerifyInternal($config);
Expand Down
5 changes: 5 additions & 0 deletions src/descriptions/id-broker-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,11 @@
'type' => [ 'string', 'object' ],
'location' => 'json',
],
'label' => [
'required' => false,
'type' => 'string',
'location' => 'json',
],
'rpOrigin' => [
'required' => false,
'type' => 'string',
Expand Down

0 comments on commit b33602a

Please sign in to comment.