The OIDC nonce of the authorization request, and the authentication time behind the code, are now
carried by the authorization code so they can be issued in the id_token on the token request.
Requires klapaudius/oauth2-php >= 1.11.
- Schema change: the
AuthCodemapping gains a nullablenoncecolumn and a nullableauth_timecolumn. Generate and run a migration (ALTER TABLE <your_auth_code_table> ADD nonce VARCHAR(255) DEFAULT NULL, ADD auth_time INT DEFAULT NULL). If your concreteAuthCodeentity declares its own mapping instead of relying on the bundle's mapped-superclass, declare both properties there as well. - BC BREAK:
AuthCodeInterfacedeclaressetNonce(?string $nonce)andsetAuthTime(?int $authTime), and inheritsgetNonce()/getAuthTime()fromOAuth2\Model\IOAuth2AuthCode. Custom implementations must provide all four (extendingFOS\OAuthServerBundle\Model\AuthCodeis enough). - BC BREAK:
OAuthStorage::createAuthCode()takes a 7th optional argument$nonce. Overrides must match the new signature. - Overridden
authorize_content.html.twigtemplates keep working throughform_rest(form); renderform.nonceexplicitly if you list the hidden fields one by one. auth_timeis not populated by the bundle: only the application knows when its user actually authenticated. Stamp it where your auth codes are created — e.g. anAuthCodeManagerInterface::createAuthCode()override reading a login timestamp recorded in the session. Left null, integrators simply omit theauth_timeclaim.
Note: XML routing files are deprecated. While they continue to work for backwards compatibility, you should migrate to YAML in your config/routes/oauth2.yaml file:
# Old (deprecated, will trigger warnings):
resource: "@FOSOAuthServerBundle/Resources/config/routing/token.xml"
# New (recommended):
resource: "@FOSOAuthServerBundle/Resources/config/routing/token.yaml"This change were made to be doctrine/dbal v4 compliant. Make sure to migrate you database schema.