Skip to content

Commit

Permalink
Better docblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
joshcanhelp committed Feb 19, 2020
1 parent 3988174 commit 5609f94
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
15 changes: 13 additions & 2 deletions src/Helpers/Tokens/IdTokenVerifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,22 @@
*/
final class IdTokenVerifier extends TokenVerifier
{

/**
* Verifies and decodes an OIDC-compliant ID token.
*
* {@inheritdoc}
* @param string $token Raw JWT string.
* @param array $options Options to adjust the verification. Can be:
* - "nonce" to check the nonce contained in the token (recommended).
* - "max_age" to check the auth_time of the token.
* - "leeway" clock tolerance in seconds for the current check only. See $leeway above for default.
*
* @return array
*
* @throws InvalidTokenException Thrown if:
* - ID token is missing (expected but none provided)
* - Signature cannot be verified
* - Token algorithm is not supported
* - Any claim-based test fails
*/
public function verify(string $token, array $options = []) : array
{
Expand Down
7 changes: 2 additions & 5 deletions src/Helpers/Tokens/TokenVerifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,16 @@ public function setLeeway(int $newLeeway) : void
}

/**
* Verifies and decodes an JWT.
* Verifies and decodes a JWT.
*
* @param string $token Raw JWT string.
* @param array $options Options to adjust the verification. Can be:
* - "nonce" to check the nonce contained in the token (recommended).
* - "max_age" to check the auth_time of the token.
* - "time" Unix timestamp to use as the current time for exp, iat, and auth_time checks. Used for testing.
* - "leeway" clock tolerance in seconds for the current check only. See $leeway above for default.
*
* @return array
*
* @throws InvalidTokenException Thrown if:
* - ID token is missing (expected but none provided)
* - Token is missing (expected but none provided)
* - Signature cannot be verified
* - Token algorithm is not supported
* - Any claim-based test fails
Expand Down

0 comments on commit 5609f94

Please sign in to comment.