Proxy Authentication
Proxy authentication support for CAS v1+ protocols is enabled by default, thus it is entirely a matter of CAS client configuration to leverage proxy authentication features.
Note that each registered application in the registry must explicitly be configured to allow for proxy authentication. See this guide to learn about registering services in the registry.
Disabling proxy authentication components is recommended for deployments that wish to strategically avoid proxy authentication as a matter of security policy.
Use Case
One of the more common use cases of proxy authentication is the ability to obtain a ticket for a back-end [REST-based] service that is also protected by CAS. The scenario usually is:
- User is faced with application A which is protected by CAS.
- Application A on the backend needs to contact a service S to produce data.
- Service S itself is protected by CAS itself.
Because A contacts service S via a server-to-service method where no browser is involved, service S would not be able to recognize that an SSO session already exists. In these cases, application A needs to exercise proxying in order to obtain a proxy ticket for service S. The proxy ticket is passed to the relevant endpoint of service S so it can retrieve and validate it via CAS and finally produce a response.
The trace route may look like this:
- Browser navigates to A.
- A redirects to CAS.
- CAS authenticates and redirects back to A with an
ST
. - A attempts to validate the
ST
, and asks for aPGT
. - CAS confirms
ST
validation, and issues a proxy-granting ticketPGT
. - A asks CAS to produce a
PT
for service S, supplying thePGT
in its request. - CAS produces a PT for service S.
- A contacts the service S endpoint, passing along
PT
in the request. - Service S attempts to validate the
PT
via CAS. - CAS validates the
PT
and produces a successful response. - Service S receives the response, and produces data for A.
- A receives and displays the data in the browser.
See the CAS Protocol for more info.
Handling SSL-enabled Proxy URLs
By default, CAS ships with a bundled HTTP client that is partly responsible to callback the URL for proxy authentication. Note that this URL need also be authorized by the CAS service registry before the callback can be made. See this guide for more info.
If the callback URL is authorized by the service registry, and if the endpoint is under HTTPS and protected by an SSL certificate, CAS will also attempt to verify the validity of the endpoint’s certificate before it can establish a successful connection. If the certificate is invalid, expired, missing a step in its chain, self-signed or otherwise, CAS will fail to execute the callback.
The HTTP client of CAS does present a local trust store that is similar to that of the Java platform. It is recommended that this trust store be used to handle the management of all certificates that need to be imported into the platform to allow CAS to execute the callback URL successfully. While by default, the local trust store to CAS is empty, CAS will still utilize both the default and the local trust store. The local trust store should only be used for CAS-related functionality of course, and the trust store file can be carried over across CAS and Java upgrades, and certainly managed by the source control system that should host all CAS configuration.
The following settings and properties are available from the CAS configuration catalog:
cas.http-client.allow-local-urls=false
Whether CAS should accept local URLs. For example
|
cas.http-client.async-timeout=PT5S
Indicates timeout for async operations. This settings supports the
|
cas.http-client.authority-validation-reg-ex-case-sensitive=true
Whether the regular expression specified with
|
cas.http-client.authority-validation-regex=
If specified the regular expression will be used to validate the url's authority.
|
cas.http-client.connection-timeout=PT5S
Connection timeout for all operations that reach out to URL endpoints. This settings supports the
|
cas.http-client.default-headers=
The default headers to use for any HTTP connection. This is defined as map, where the key is the header name and the value is the header value that should be sent along with request.
|
cas.http-client.host-name-verifier=default
Enable hostname verification when attempting to contact URL endpoints. May also be set to
|
cas.http-client.proxy-host=
Send requests via a proxy; define the hostname.
|
cas.http-client.proxy-port=0
Send requests via a proxy; define the proxy port. Negative/zero values should deactivate the proxy configuration for the http client.
|
cas.http-client.read-timeout=PT5S
Read timeout for all operations that reach out to URL endpoints. This settings supports the
|
cas.http-client.socket-timeout=PT5S
Defines the socket timeout in milliseconds, which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets). A timeout value of zero is interpreted as an infinite timeout. A negative value is interpreted as undefined (system default if applicable). This settings supports the
|
cas.http-client.truststore.file=
The CAS local truststore resource to contain certificates to the CAS deployment. In the event that local certificates are to be imported into the CAS running environment, a local truststore is provided by CAS to improve portability of configuration across environments.
|
cas.http-client.truststore.psw=changeit
The truststore password.
|
cas.http-client.truststore.type=
Truststore type used to create a SSL context for http client.
|