shinyproxy generate wrong redirect uri when using keycloak
See original GitHub issueHello,
my setup is like this.
shinyproxy runs in a docker container with name shiny-proxy.
apache httpd reverse proxy runs before shinyproxy and convert it to https and runs on the host with port 2443 keycloak is also runs in docker container but the port is open on the host with 8443.
setup, application.xml
keycloak:
realm: shiny
auth-server-url: https://keycloak:8443/auth
#ssl-required: none
ssl-required: external
confidential-port: 2443
verify-token-audience: true
resource: shiny-proxy-p1
credentials-secret: xxxxxxxxxxxx
apache reverse proxy configuration
<VirtualHost *:2443>
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/server-cert.pem
SSLCertificateKeyFile /etc/apache2/ssl/server-cert.key
# Server Certificate Chain:
# Point SSLCertificateChainFile at a file containing the
# concatenation of PEM encoded CA certificates which form the
# certificate chain for the server certificate. Alternatively
# the referenced file can be the same as SSLCertificateFile
# when the CA certificates are directly appended to the server
# certificate for convinience.
SSLCertificateChainFile /etc/apache2/ssl/server-ca.crt
<Proxy *>
Allow from *
</Proxy>
RewriteEngine on
RewriteCond %{HTTP:Upgrade} =websocket
RewriteRule /(.*) ws://shiny-proxy:8080/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket
RewriteRule /(.*) http://shiny-proxy:8080/$1 [P,L]
ProxyPass / http://shiny-proxy:8080/
ProxyPassReverse / http://shiny-proxy:8080/
ProxyRequests Off
ErrorLog ${APACHE_LOG_DIR}/proxy_error.log
CustomLog ${APACHE_LOG_DIR}/proxy_access.log combined
</VirtualHost>
Let’s say when access shinyprox via apache with URL https://lxsqlpocnd04:2443/ it will redirect to login page and the login page redirect request to Keycloak host lxsqlpocnd04 and port 8443. in that URL there is query string which includes redirect_uri but it is not the one expected.
And the redirect_uri is http://shiny-proxy:8080/sso/login other than https://lxsqlpocnd04:2443/sso/login
could someone help ?
Thanks,
Robin
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (4 by maintainers)
Top GitHub Comments
@danielfm123 @eastclintw00d POST requests (as made e.g. by DT) don’t work when using OIDC with current ShinyProxy (2.4.1). A fix by @LEDfan will be part of an upcoming release, but this is not the topic of this thread.
Hi @LEDfan
That solved the problem.
Thank you for the quick response!