Home > Enterprise >  ProxyPass for Keycloak Admin Console Redirection
ProxyPass for Keycloak Admin Console Redirection

Time:11-08

Currently Keycloak is running in a Docker Container (8080:8080) and reachable in frontend and admin console by the ProxyPass from Apache, all fine. Is there a way for Keycloak to map the admin console directly for / ?

ProxyPreserveHost on
RequestHeader set "Host" "auth.myapp.com"
RequestHeader set "X-Forwarded-For" "auth.myapp.com"
RequestHeader set "X-Forwarded-Server" "auth.myapp.com"
RequestHeader set "X-Forwarded-Proto" "https"
RequestHeader set "X-Forwarded-Port" "443"
RequestHeader set "X-Forwarded-Host" "auth.myapp.com"

ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/

When I browse to https://auth.myapp.com the Keycloak Frontend will be redirect me to https://auth.myapp.com/auth and I have to click on "Admin Console" additionally.

The Admin Console Login is https://auth.myapp.com/auth/admin (and going be redirected automatically to https://auth.myapp.com/auth/realms/master/protocol/openid-connect/auth?client_id=security-admin-console) - but after this I can see the login from the Admin Console. So far, so good. But is there a way to redirect automatically to the console page?

ProxyPass / http://localhost:8080/auth/realms
ProxyPassReverse / http://localhost:8080/auth/realms

Not Working

ProxyPass / http://localhost:8080/auth/admin
ProxyPassReverse / http://localhost:8080/auth/admin

Not Working

Thanks for your help.

CodePudding user response:

Thanks, for your hint. This solve my issue.

ProxyPassMatch ^/auth(/(index.html)?)?$ !
RedirectMatch ^/auth(/(index.html)?)?$ /auth/admin
  • Related