Service Ticket - REST Protocol
The below snippets show one might request a service ticket using the semantics of the CAS protocol:
1
2
3
POST /cas/v1/tickets/{TGT id} HTTP/1.0
service={form encoded parameter for the service url}
You may also specify a renew
parameter to obtain a service ticket that can
be accepted by a service that only wants tickets issued from the presentation
of the user’s primary credentials. In that case, user credentials have to be
passed in the request, for example, as username
and password
parameters.
1
2
3
POST /cas/v1/tickets/{TGT id} HTTP/1.0
service={form encoded parameter for the service url}&renew=true&username=casuser&password=password
You may also submit service ticket requests using the semantics SAML1 protocol.
Successful Response
1
2
200 OK
ST-1-FFDFHDSJKHSDFJKSDHFJKRUEYREWUIFSD2132
JWT Service Tickets
Service tickets created by the REST protocol may be issued as JWTs instead. See this guide to learn more.
Support is enabled by including the following in your overlay:
1
2
3
4
5
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-support-rest-tokens</artifactId>
<version>${cas.version}</version>
</dependency>
1
implementation "org.apereo.cas:cas-server-support-rest-tokens:${project.'cas.version'}"
1
2
3
4
5
6
7
8
9
dependencyManagement {
imports {
mavenBom "org.apereo.cas:cas-server-support-bom:${project.'cas.version'}"
}
}
dependencies {
implementation "org.apereo.cas:cas-server-support-rest-tokens"
}
1
2
3
4
5
6
dependencies {
implementation enforcedPlatform("org.apereo.cas:cas-server-support-bom:${project.'cas.version'}")
implementation platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
implementation "org.apereo.cas:cas-server-support-rest-tokens"
}
The following settings and properties are available from the CAS configuration catalog:
cas.authn.token.principal-transformation.groovy.location=
The location of the resource. Resources can be URLS, or files found either on the classpath or outside somewhere in the file system. In the event the configured resource is a Groovy script, specially if the script set to reload on changes, you may need to adjust the total number ofinotify instances. On Linux, you may need to add the following line to /etc/sysctl.conf : fs.inotify.max_user_instances = 256 . You can check the current value via cat /proc/sys/fs/inotify/max_user_instances .
|
cas.authn.token.crypto.encryption.key=
The encryption key is a JWT whose length is defined by the encryption key size setting. |
cas.authn.token.crypto.signing.key=
The signing key is a JWT whose length is defined by the signing key size setting. |
cas.authn.token.principal-transformation.blocking-pattern=
A regular expression that will be used against the username to match for blocking/forbidden values. If a match is found, an exception will be thrown and principal transformation will fail. |
cas.authn.token.principal-transformation.case-conversion=NONE
Indicate whether the principal identifier should be transformed into upper-case, lower-case, etc. Available values are as follows:
|
cas.authn.token.principal-transformation.pattern=
A regular expression that will be used against the provided username for username extractions. On a successful match, the first matched group in the pattern will be used as the extracted username. |
cas.authn.token.principal-transformation.prefix=
Prefix to add to the principal id prior to authentication. |
cas.authn.token.principal-transformation.suffix=
Suffix to add to the principal id prior to authentication. |
cas.authn.token.crypto.alg=
The signing/encryption algorithm to use. |
cas.authn.token.crypto.enabled=true
Whether crypto operations are enabled. |
cas.authn.token.crypto.encryption-enabled=true
Whether crypto encryption operations are enabled. |
cas.authn.token.crypto.encryption.key-size=512
The encryption key size. |
cas.authn.token.crypto.signing-enabled=true
Whether crypto signing operations are enabled. |
cas.authn.token.crypto.signing.key-size=512
The signing key size. |
cas.authn.token.crypto.strategy-type=ENCRYPT_AND_SIGN
Control the cipher sequence of operations. The accepted values are:
|
cas.authn.token.webflow.enabled=true
Whether webflow auto-configuration should be enabled. |
cas.authn.token.webflow.order=0
The order in which the webflow is configured. |
cas.authn.token.name=
Name of the authentication handler. |
cas.authn.token.state=
Define the scope and state of this authentication handler and the lifecycle in which it can be invoked or activated. Available values are as follows:
|