Skip to content

Refuse reserved authorization parameters in the entry point options - #96

Merged
robertlemke merged 1 commit into
mainfrom
bugfix/reserved-authorization-parameters
Oct 12, 2026
Merged

robertlemke merged 1 commit into
mainfrom
bugfix/reserved-authorization-parameters

Conversation

@robertlemke

@robertlemke robertlemke commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

The entry point option authorizationParameters accepted parameters which the client sets itself, like "nonce", "state" or "redirect_uri". Starting a login then threw an uncaught InvalidArgumentException, so every login ended with status 500. The entry point now refuses such names when it validates its options and reports them as a ConfigurationException, like other misconfiguration.

The client checks against the same list of reserved names before it hands the parameters to the OAuth client. A call of startAuthorization() with "state" or another name which the OAuth client sets therefore fails with the InvalidArgumentException code 1791540882 of this package, instead of 1789131855 of flownative/oauth2-client.

The entry point now refuses an "authorizationParameters" option which
contains a parameter the client sets itself, like "nonce", "state" or
"redirect_uri". This is reported as a ConfigurationException, like
other invalid options of the entry point.

Previously, the option was only checked for string names and values.
Such a parameter passed that check, and starting the login then threw
an InvalidArgumentException, which the entry point doesn't catch. Every
login ended with status 500 instead of pointing to the configuration.

The client now names all reserved parameters itself, including those
which the OAuth client sets, so that the entry point can check its
options against the same list. The OAuth client keeps its own list
private, so the names are repeated here.
@robertlemke
robertlemke force-pushed the bugfix/reserved-authorization-parameters branch from 71f0ae4 to 51b3a1e Compare October 12, 2026 10:14
@robertlemke
robertlemke merged commit 260ef57 into main Oct 12, 2026
12 checks passed
@robertlemke
robertlemke deleted the bugfix/reserved-authorization-parameters branch October 12, 2026 12:20
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.

1 participant