JAAS Authentication
JAAS is a Java standard authentication and authorization API. JAAS is configured via externalized plain text configuration file. Using JAAS with CAS allows modification of the authentication process without having to rebuild and redeploy CAS and allows for PAM-style multi-module “stacked” authentication.
Configuration
JAAS components are provided in the CAS core module and require no additional dependencies to use. The JAAS handler delegates to the built-in JAAS subsystem to perform authentication according to the directives in the JAAS config file.
The following settings and properties are available from the CAS configuration catalog:
cas.authn.jaas[0].password-encoder.encoding-algorithm=
The encoding algorithm to use such as
|
cas.authn.jaas[0].password-encoder.type=NONE
Define the password encoder type to use.
Type may be specified as blank or
|
cas.authn.jaas[0].realm=
JAAS realm to use.
|
cas.authn.jaas[0].password-policy.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.jaas[0].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.jaas[0].principal.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.jaas=
Collection of settings related to JAAS authentication. These settings are required to be indexed (i.e. jaas[0].xyz).
|
cas.authn.jaas[0].credential-criteria=
A number of authentication handlers are allowed to determine whether they can operate on the provided credential and as such lend themselves to be tried and tested during the authentication handler selection phase. The credential criteria may be one of the following options:
|
cas.authn.jaas[0].kerberos-kdc-system-property=
Typically, the default realm and the KDC for that realm are indicated in the Kerberos krb5.conf file is also provided from which the additional information required for cross-realm authentication
may be obtained.
If you set values for these properties, then they override the default realm and KDC values specified
in krb5.conf (if such a file is found). The krb5.conf file is still consulted if values for items
other than the default realm and KDC are needed. If no krb5.conf file is found,
then the default values used for these items are implementation-specific.
|
cas.authn.jaas[0].kerberos-realm-system-property=
Typically, the default realm and the KDC for that realm are indicated in the Kerberos krb5.conf file is also provided from which the additional information required for cross-realm authentication
may be obtained.
If you set values for these properties, then they override the default realm and KDC values specified
in krb5.conf (if such a file is found). The krb5.conf file is still consulted if values for items
other than the default realm and KDC are needed. If no krb5.conf file is found,
then the default values used for these items are implementation-specific.
|
cas.authn.jaas[0].login-config-type=
Typically set to
|
cas.authn.jaas[0].login-configuration-file=
Path to the location of configuration file (i.e. jaas.conf) that contains the realms and login modules.
|
cas.authn.jaas[0].name=
Name of the authentication handler.
|
cas.authn.jaas[0].order=MAX_VALUE
Order of the authentication handler in the chain.
|
cas.authn.jaas[0].password-encoder.character-encoding=UTF-8
The encoding algorithm to use such as 'UTF-8'.
Relevant when the type used is
|
cas.authn.jaas[0].password-encoder.hash-length=16
When used by
|
cas.authn.jaas[0].password-encoder.secret=
Secret to use with
|
cas.authn.jaas[0].password-encoder.strength=16
Strength or number of iterations to use for password hashing.
Usually relevant when dealing with
|
cas.authn.jaas[0].password-policy.account-state-handling-enabled=true
Indicates whether account state handling should be enabled to process warnings or errors reported back from the authentication response, produced by the source.
|
cas.authn.jaas[0].password-policy.display-warning-on-match=true
Indicates if warning should be displayed, when the ldap attribute value
matches the
|
cas.authn.jaas[0].password-policy.enabled=true
Whether password policy should be enabled.
|
cas.authn.jaas[0].password-policy.login-failures=5
When dealing with FreeIPA, indicates the number of allows login failures.
|
cas.authn.jaas[0].password-policy.policy-attributes=
Key-value structure (Map) that indicates a list of boolean attributes as keys.
If either attribute value is true, indicating an account state is flagged,
the corresponding error can be thrown.
Example
|
cas.authn.jaas[0].password-policy.strategy=DEFAULT
Decide how authentication should handle password policy changes. Available values are as follows:
|
cas.authn.jaas[0].password-policy.warn-all=
Always display the password expiration warning regardless.
|
cas.authn.jaas[0].password-policy.warning-attribute-name=
Used by an account state handling policy that only calculates account warnings in case the entry carries this attribute.
|
cas.authn.jaas[0].password-policy.warning-attribute-value=
Used by an account state handling policy that only calculates account warnings
in case the entry carries an attribute
|
cas.authn.jaas[0].password-policy.warning-days=30
This is used to calculate a warning period to see if account expiry is within the calculated window.
|
cas.authn.jaas[0].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.jaas[0].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.jaas[0].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.jaas[0].principal-transformation.prefix=
Prefix to add to the principal id prior to authentication.
|
cas.authn.jaas[0].principal-transformation.suffix=
Suffix to add to the principal id prior to authentication.
|
cas.authn.jaas[0].principal.active-attribute-repository-ids=
Activated attribute repository identifiers that should be used for fetching attributes if attribute resolution is enabled. The list here may include identifiers separated by comma.
|
cas.authn.jaas[0].principal.attribute-resolution-enabled=UNDEFINED
Whether attribute repositories should be contacted to fetch person attributes. Defaults to true if not set.
|
cas.authn.jaas[0].principal.principal-attribute=
Attribute name to use to indicate the identifier of the principal constructed. If the attribute is blank or has no values, the default principal id will be used determined by the underlying authentication engine. The principal id attribute usually is removed from the collection of attributes collected, though this behavior depends on the schematics of the underlying authentication strategy.
|
cas.authn.jaas[0].principal.principal-resolution-conflict-strategy=last
In the event that the principal resolution engine resolves
more than one principal, (specially if such principals in the chain
have different identifiers), this setting determines strategy by which
the principal id would be chosen from the chain.
Accepted values are:
|
cas.authn.jaas[0].principal.principal-resolution-failure-fatal=UNDEFINED
When true, throws an error back indicating that principal resolution has failed and no principal can be found based on the authentication requirements. Otherwise, logs the condition as an error without raising a catastrophic error.
|