-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[Bug]: Logout failing witch "Missing parameters: id_token_hint" when using Keycloak #3610
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
Comments
Hi @ahlund! I'm Dosu and I’m helping the Stirling-PDF team. The error from Keycloak—"Missing parameters: id_token_hint"—happens because the logout URL generated by Stirling-PDF is missing both the Your Stirling-PDF logs show that To resolve this, check your Stirling-PDF configuration file (typically security:
enableLogin: true
loginMethod: oauth2
oauth2:
client:
keycloak:
issuer: "https://hello.example.com/realms/MyRealm"
clientId: "<YOUR_CLIENT_ID>"
clientSecret: "<YOUR_CLIENT_SECRET>"
scopes: "openid, profile, email" Make sure to replace After updating and saving the configuration, restart Stirling-PDF. This should ensure that the If you continue to see issues, double-check that the configuration file is being loaded correctly and that there are no typos or indentation errors. There are currently no known bugs or open issues in the Stirling-PDF repository related to this specific logout problem or the To reply, just mention my name @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
If there is a problem with the security settings then it would not be possible to login, right? I have no problem logging in, only logging out. |
You're correct that if there were a general problem with your security or OAuth2 settings, you would likely not be able to log in at all. The fact that login works means your basic OAuth2 configuration (client ID, secret, issuer, etc.) is valid for authentication. However, the logout process in OpenID Connect (and with Keycloak) has additional requirements that are not needed for login. Specifically, when using In your logs, the logout URL generated by Stirling-PDF is missing both parameters (the Based on available documentation, there are no Stirling-PDF settings that specifically control only the logout process or these parameters—logout handling appears to rely on the same OAuth2 configuration as login, but the implementation may not be passing all required values for logout in your version. This is why you see the error only during logout, not login. If your configuration already has the correct In summary: login and logout use related but distinct flows, and it's possible for one to work while the other fails if the application does not handle the logout parameters required by Keycloak. To reply, just mention my name @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Here is the problem. I set the clientId in:
However, there is another setting for clientId in:
It seems that the first setting is used for logins but the second one is used for logout. Setting the correct clientId in both places fixes the problem which, in my opinion, is a settings file parsing bug. |
@DarioGii could that be the problem? Stirling-PDF/src/main/java/stirling/software/SPDF/config/security/CustomLogoutSuccessHandler.java Line 149 in 2217cfb
|
Installation Method
Local Installation
The Problem
Using Keycloak, when trying to log out I get an error message from Keycloak: "Missing parameters: id_token_hint".
Version of Stirling-PDF
0.46.2
Last Working Version of Stirling-PDF
No response
Page Where the Problem Occurred
No response
Docker Configuration
Relevant Log Output
Additional Information
Notice that the client_id is empty. This might be the problem.
The server is running:
Browsers Affected
No response
No Duplicate of the Issue
The text was updated successfully, but these errors were encountered: