I have an Keycloak server and using mod_auth on Apache to manage the request.
Currently, in my client application, when I face with a 401 request, I trigger an location.reload() and thus being redirected to Keycloak logging page. But this feel very unnatural.
I want to ask if there is another, office way that do the redirecting automatically from Keycloak side/server side?
//////Edited////
I use mod_auth_openidc for Apache, which mean there is no adapter on client-side
Keyckoak version:4.4.0
You can use
OIDCUnAuthActionto configure the action to be taken on an incoming unauthenticated request, see: https://github.com/zmartzone/mod_auth_openidc/blob/v2.3.8/auth_openidc.conf#L697This is a per-path/location/directory setting, so in your case you'd configure:
on that specific path.