Skip to content

Refactor jwt handling #488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open

Conversation

SamuelWei
Copy link
Contributor

@SamuelWei SamuelWei commented Jun 24, 2025

List of common tasks a pull request require complete

  • Changelog entry is added or the pull request don't alter library's functionality

Closes #484

Added

Changed

Removed

  • getResponseCode(), replaced with new response method getStatus()
  • getResponseContentType(), replaced with new response method getContentType()
  • verifyJWTClaims(), replaced with individual checks using the ClaimCheckerManager, as the claims that have to be checked are too different across the different types of requests to move logic to a simple function
  • validateIssuer(), replaced with IssuerChecker
  • verifyJWTSignature(), replaced with verifyJWSSignature()

Fixed


Comments

1: Nonce must be present, see https://openid.net/specs/openid-connect-core-1_0.html#IDTokenValidation and https://openid.net/specs/openid-connect-core-1_0.html#ImplicitIDTValidation as we always send a nonce to the OpenID Connect server (see https://github.com/jumbojett/OpenID-Connect-PHP/blob/master/src/OpenIDConnectClient.php#L761)

@SamuelWei
Copy link
Contributor Author

SamuelWei commented Jun 30, 2025

@DeepDiver1975 This PR implements the changes discussed in #484 and a few other items, as listed above.

What are your thoughts? I also added a few new tests

Are you fine with creating the tokens/jwts during the tests, or should they all be pre-created and stored in fixtures ?

@SamuelWei SamuelWei marked this pull request as ready for review July 1, 2025 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor JWT handling + Bump min PHP version Support for elliptic curve (EC) JWT token signature algorithms
1 participant