Support for load balancer and maxAuthenticationAge in SAML #32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request covers two issues I've come across when using SAML authentication.
First, when ShinyProxy/ContainerProxy is running behind a load balancer (or in my case a Kubernetes ingress controller) and SSL traffic is terminated at the load balancer, then authentication fails with the following error:
The issue is fixed by using the SAMLContextProviderLB context provider.
The implementation exposes the following new configuration options under
proxy.saml
:lb-server-name
: Server name of the load balancer. By setting this option, load balancer support is enabled.lb-context-path
: Context path of the load balancer. Optional. Default value/
.lb-port-in-url
: Include server port in construction of load balancer request URL. Optional. Default valuefalse
.lb-scheme
: Scheme of the load balancer - either http or https. Optional. Default valuehttps
.lb-server-port
: Port of the load balancer server. Optional. Default value443
.Second, if the IDP issues tokens that are valid longer than 7200 seconds, then the following error can occur
CredentialsExpiredException: Authentication statement is too old to be used
.This issue is fixed by exposing the following configuration setting:
proxy.saml.max-auth-age
: Maximum time (in seconds) between users authentication and processing of an authentication statement.and setting it to a sufficiently high value.
More details and a build of the ShinyProxy jar which incorporates these changes can be found here.