Skip to content

Commit

Permalink
Test both cases (right/wrong password for WebAuthn MFA API)
Browse files Browse the repository at this point in the history
  • Loading branch information
forevermatt committed May 30, 2024
1 parent 4f15d8f commit 6e49e09
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
11 changes: 8 additions & 3 deletions application/features/authentication.feature
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,18 @@ Feature: Authentication
And The user's current password should be marked as pwned
And The user's password is expired

Scenario: Successfully authenticate even though WebAuthn MFA API is down
Scenario Outline: Successfully authenticate even though WebAuthn MFA API is down
Given "shep_clark" has a valid WebAuthn MFA method
And I provide the following valid data:
| property | value |
| username | shep_clark |
| password | govols!!! |
But we have the wrong password for the WebAuthn MFA API
And we have the <rightOrWrongPassword> for the WebAuthn MFA API
When I request "/authentication" be created
Then the response status code should be 200
But the response body should not contain "publicKey"
And the response body should <containPublicKeyOrNot>

Examples:
| rightOrWrongPassword | containPublicKeyOrNot |
| wrong password | not contain "publicKey" |
| right password | contain "publicKey" |
8 changes: 8 additions & 0 deletions application/features/bootstrap/AuthenticationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,12 @@ protected function setWebAuthnApiSecretTo(string $newPlainTextApiSecret)
'TableName' => Env::get('API_KEY_TABLE'),
]);
}

/**
* @Given we have the right password for the WebAuthn MFA API
*/
public function weHaveTheRightPasswordForTheWebauthnMfaApi()
{
$this->setWebAuthnApiSecretTo(Env::get('MFA_WEBAUTHN_apiSecret'));
}
}

0 comments on commit 6e49e09

Please sign in to comment.