I am trying to integarte keycloak authentication for securing my application.
My server and client has different error status code mapping.
In case of accessToken expires keycloak sends 401 directly to client
where I have mapped token expiration to status code 5401.
I do not wish to change this mapping as code is already in production phase.
I found very helpful way to handle this situaltion by providing
error-page in my server web.xml as
<login-config>
<auth-method>KEYCLOAK</auth-method>
<realm-name>winterfell</realm-name>
<form-login-config>
<form-error-page>/error</form-error-page>
</form-login-config>
</login-config>
But somehow I am not able to get this error page.
Can someone please suggest correct way of doing this.
Note : Following way didn't worked for me
<error-page>
<error-code>404</error-code>
<location>/error</location>
</error-page>
-TR
John