Skip to content

Avoid max_age empty parameter on authorize_url - #132

Merged
picman merged 1 commit into
kontron:develfrom
entaksi:main
Jun 25, 2026
Merged

Avoid max_age empty parameter on authorize_url#132
picman merged 1 commit into
kontron:develfrom
entaksi:main

Conversation

@campisanoentaksi

Copy link
Copy Markdown
Contributor

I have an issue with the version 4.0.9 that includes the enhancement discussed in #95
There is no problem with the 4.0.8.

I'm using Keycloak, and I'm testing with the Keycloak provider as well as with the Custom one.

In both cases, the plugin probably reads params[:reauth] == 0, sets the max_age to nil, which causes an invalid request to Keycloak. In the request URL, I can see a max_age parameter without a value:
...code_challenge_method=S256&max_age&scope=...

and Keycloak tries to convert max_age to an int, causing an internal error, preventing the login:

Invalid request: java.lang.NumberFormatException: For input string: ""
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:xx)
	at java.base/java.lang.Integer.parseInt(Integer.java:xxx)
	at java.base/java.lang.Integer.valueOf(Integer.java:xxx)
	at org.keycloak.protocol.oidc.endpoints.request.AuthzEndpointQueryStringParser.getIntParameter(AuthzEndpointQueryStringParser.java:xx)

In the pull request, I'm just compacting the hash used as input for the authorize_url function to generally avoid sending null keys.

@picman
picman changed the base branch from main to devel June 25, 2026 10:57
@picman
picman self-requested a review June 25, 2026 10:58
@picman picman added the bug Something isn't working label Jun 25, 2026
@picman picman added this to the 4.1.0 milestone Jun 25, 2026
@picman
picman merged commit e4f4be8 into kontron:devel Jun 25, 2026
1 check passed
@picman

picman commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Excellent, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants