You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
POST logout() gets error 'invalid parameter id_token_hint' from server, when the user already has been unauthenticated #287
When calling the logout() method using the POST method option and the Keycloak session has already been expired and user has already been unauthenticated (the idToken has been removed), the Keycloak server returns with an error invalid parameter id_token_hint. Calling the method using the GET method option, Keycloak does not respond with an error.
The cause is a different checking of the current idToken. With the GET logout method the parameter id_token_hint is only added to the url, if the idToken is actually present and defined.
With the POST logout method the parameter id_token_hint is always added to the form data, even if the idToken is not present and undefined. There is no check, if the idToken is present.
Version
26.5.6
Expected behavior
When calling POST logout() in an expired session and the user is already unauthenticated, the parameter id_token_hint with its value undefined should be omitted from the request data, like GET logout() does.
POST data:
// Add data to form as hidden input fields.
// Match behavior of createLogoutUrl() for GET requests.
const data = {
client_id: this.clientId,
post_logout_redirect_uri: redirectUri(options)
}
// Only add id token parameter when it is present to avoid error 'invalid id token hint'
if (this.idToken) {
data.id_token_hint = this.idToken
}
Actual behavior
When calling POST logout() with an expired session and the user is already unauthenticated, the parameter id_token_hint with its value undefined is present in the request data and is not filtered, resulting in the described error.
POST data:
// Add data to form as hidden input fields.
const data = {
id_token_hint: this.idToken,
client_id: this.clientId,
post_logout_redirect_uri: redirectUri(options)
}
How to Reproduce?
Use and call the POST logout() method with an expired session and the user has already been unauthenticated.
Activity
Handle unauthenticated POST logout() scenarios, matching `createLogou…
sparqueur commentedon Jun 26, 2026
Any news ? We have the same error.