Passwordless Authentication
Passwordless Authentication is a form of authentication in CAS where passwords take the form of tokens that expire after a configurable period of time. Using this strategy, users are asked for an identifier (i.e. username) which is used to locate the user record that contains forms of contact such as email and phone number. Once located, the CAS-generated token is sent to the user via the configured notification strategies (i.e. email, sms, etc) where the user is then expected to provide the token back to CAS in order to proceed.
Presently, there is no support for magic links that would remove the task of providing the token back to CAS allowing the user to proceed automagically. This variant may be worked out in future releases.
In order to successfully implement this feature, configuration needs to be in place to contact account stores that hold user records who qualify for passwordless authentication. Similarly, CAS must be configured to manage issued tokens in order to execute find, validate, expire or save operations in appropriate data stores.
Passwordless Variants
Passwordless authentication can also be activated using QR Code Authentication, allowing end users to login by scanning a QR code using a mobile device.
Passwordless authentication can also be achieved via FIDO2 WebAuthn which lets users verify their identities without passwords and login using FIDO2-enabled devices.
Overview
Support is enabled by including the following module in the overlay:
1
2
3
4
5
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-support-passwordless-webflow</artifactId>
<version>${cas.version}</version>
</dependency>
1
implementation "org.apereo.cas:cas-server-support-passwordless-webflow:${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-passwordless-webflow"
}
1
2
3
4
5
6
7
8
9
10
dependencies {
/*
The following platform references should be included automatically and are listed here for reference only.
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-passwordless-webflow"
}
The following settings and properties are available from the CAS configuration catalog:
cas.authn.passwordless.core.delegated-authentication-selector-script.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.passwordless.core.delegated-authentication-activated=false
Allow passwordless authentication to skip its own flow in favor of delegated authentication providers that may be available and defined in CAS. If delegated authentication is activated, CAS will skip its normal passwordless authentication flow in favor of the requested delegated authentication provider. If no delegated providers are available, passwordless authentication flow will commence as usual.
|
cas.authn.passwordless.core.multifactor-authentication-activated=false
Allow passwordless authentication to skip its own flow in favor of multifactor authentication providers that may be available and defined in CAS. If multifactor authentication is activated, and defined MFA triggers in CAS signal availability and eligibility of an MFA flow for the given passwordless user, CAS will skip its normal passwordless authentication flow in favor of the requested multifactor authentication provider. If no MFA providers are available, or if no triggers require MFA for the verified passwordless user, passwordless authentication flow will commence as usual.
|
Configuration Metadata
The collection of configuration properties listed in this section are automatically generated from the CAS source and components that contain the actual field definitions, types, descriptions, modules, etc. This metadata may not always be 100% accurate, or could be lacking details and sufficient explanations.
Be Selective
This section is meant as a guide only. Do NOT copy/paste the entire collection of settings into your CAS configuration; rather pick only the properties that you need. Do NOT enable settings unless you are certain of their purpose and do NOT copy settings into your configuration only to keep them as reference. All these ideas lead to upgrade headaches, maintenance nightmares and premature aging.
YAGNI
Note that for nearly ALL use cases, declaring and configuring properties listed here is sufficient. You should NOT have to explicitly massage a CAS XML/Java/etc configuration file to design an authentication handler, create attribute release policies, etc. CAS at runtime will auto-configure all required changes for you. If you are unsure about the meaning of a given CAS setting, do NOT turn it on without hesitation. Review the codebase or better yet, ask questions to clarify the intended behavior.
Naming Convention
Property names can be specified in very relaxed terms. For instance cas.someProperty
, cas.some-property
, cas.some_property
are all valid names. While all
forms are accepted by CAS, there are certain components (in CAS and other frameworks used) whose activation at runtime is conditional on a property value, where
this property is required to have been specified in CAS configuration using kebab case. This is both true for properties that are owned by CAS as well as those
that might be presented to the system via an external library or framework such as Spring Boot, etc.
When possible, properties should be stored in lower-case kebab format, such as cas.property-name=value
.
The only possible exception to this rule is when naming actuator endpoints; The name of the
actuator endpoints (i.e. ssoSessions
) MUST remain in camelCase mode.
Settings and properties that are controlled by the CAS platform directly always begin with the prefix cas
. All other settings are controlled and provided
to CAS via other underlying frameworks and may have their own schemas and syntax. BE CAREFUL with
the distinction. Unrecognized properties are rejected by CAS and/or frameworks upon which CAS depends. This means if you somehow misspell a property definition
or fail to adhere to the dot-notation syntax and such, your setting is entirely refused by CAS and likely the feature it controls will never be activated in the
way you intend.
Validation
Configuration properties are automatically validated on CAS startup to report issues with configuration binding, specially if defined CAS settings cannot be
recognized or validated by the configuration schema. The validation process is on by default and can be skipped on startup using a special system
property SKIP_CONFIG_VALIDATION
that should be set to true
. Additional validation processes are also handled
via Configuration Metadata and property migrations applied automatically on
startup by Spring Boot and family.
Indexed Settings
CAS settings able to accept multiple values are typically documented with an index, such as cas.some.setting[0]=value
. The index [0]
is meant to be
incremented by the adopter to allow for distinct multiple configuration blocks.
Account Stores
User records that qualify for passwordless authentication must be found by CAS using one of the following strategies. All strategies may be configured using CAS settings and are activated depending on the presence of configuration values.
Option | Description |
---|---|
Simple | Please see this guide. |
MongoDb | Please see this guide. |
LDAP | Please see this guide. |
JSON | Please see this guide. |
Groovy | Please see this guide. |
REST | Please see this guide. |
Custom | Please see this guide. |
Token Management
The following strategies define how issued tokens may be managed by CAS.
The following settings and properties are available from the CAS configuration catalog:
cas.authn.passwordless.accounts.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.passwordless.accounts.json.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.passwordless.accounts.rest.url=
The endpoint URL to contact and retrieve attributes.
|
cas.authn.passwordless.accounts.ldap.base-dn=
Base DN to use. There may be scenarios where different parts of a single LDAP tree could be considered as base-dns. Rather than duplicating the LDAP configuration block for each individual base-dn, each entry can be specified and joined together using a special delimiter character. The user DN is retrieved using the combination of all base-dn and DN resolvers in the order defined. DN resolution should fail if multiple DNs are found. Otherwise the first DN found is returned. Usual syntax is:
|
cas.authn.passwordless.accounts.ldap.bind-credential=
The bind credential to use when connecting to LDAP.
|
cas.authn.passwordless.accounts.ldap.bind-dn=
The bind DN to use when connecting to LDAP. LDAP connection configuration injected into the LDAP connection pool can be initialized with the following parameters:
|
cas.authn.passwordless.accounts.ldap.ldap-url=
The LDAP url to the server. More than one may be specified, separated by space and/or comma.
|
cas.authn.passwordless.accounts.ldap.search-filter=
User filter to use for searching. Syntax is file:/path/to/GroovyScript.groovy to fully build the final filter template dynamically.
|
cas.authn.passwordless.accounts.mongo.client-uri=
The connection uri to the mongodb instance. This typically takes on the form of
|
cas.authn.passwordless.accounts.mongo.collection=
MongoDb database collection name to fetch and/or create.
|
cas.authn.passwordless.accounts.mongo.database-name=
MongoDb database instance name.
|
cas.authn.passwordless.accounts.mongo.host=localhost
MongoDb database host for authentication. Multiple host addresses may be defined, separated by comma. If more than one host is defined, it is assumed that each host contains the port as well, if any. Otherwise the configuration may fallback onto the port defined.
|
cas.authn.passwordless.accounts.mongo.password=
MongoDb database password for authentication.
|
cas.authn.passwordless.accounts.mongo.port=27017
MongoDb database port.
|
cas.authn.passwordless.accounts.mongo.user-id=
MongoDb database user for authentication.
|
cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].case-change.attribute-name-case-change=
The Attribute name case change.
|
cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].case-change.attribute-names=
The Attribute names.
|
cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].case-change.attribute-value-case-change=
The Attribute value case change.
|
cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].case-change.dn-case-change=
The Dn case change.
|
cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].dn-attribute.add-if-exists=
The Add if exists.
|
cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].dn-attribute.dn-attribute-name=entryDN
The Dn attribute name.
|
cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].merge-attribute.attribute-names=
The Attribute names.
|
cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].merge-attribute.merge-attribute-name=
The Merge attribute name.
|
cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].primary-group-id.base-dn=
The Base dn.
|
cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].primary-group-id.group-filter=(&(objectClass=group)(objectSid={0}))
The Group filter.
|
cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].recursive.merge-attributes=
The Merge attributes.
|
cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].recursive.search-attribute=
The Search attribute.
|
cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].search-referral.limit=10
The default referral limit.
|
cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].search-result.limit=10
The default referral limit.
|
cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].type=
The type of search entry handler to choose. Available values are as follows:
|
cas.authn.passwordless.accounts.ldap.validator.attribute-name=objectClass
Attribute name to use for the compare validator.
|
cas.authn.passwordless.accounts.ldap.validator.attribute-value=top
Attribute values to use for the compare validator.
|
cas.authn.passwordless.accounts.ldap.validator.base-dn=
Base DN to use for the search request of the search validator.
|
cas.authn.passwordless.accounts.ldap.validator.dn=
DN to compare to use for the compare validator.
|
cas.authn.passwordless.accounts.ldap.validator.scope=OBJECT
Search scope to use for the search request of the search validator.
|
cas.authn.passwordless.accounts.ldap.validator.search-filter=(objectClass=*)
Search filter to use for the search request of the search validator.
|
cas.authn.passwordless.accounts.ldap.validator.type=search
Determine the LDAP validator type. The following LDAP validators can be used to test connection health status:
|
cas.authn.passwordless.accounts.mongo.pool.idle-time=PT30S
The maximum idle time of a pooled connection. A zero value indicates no limit to the idle time. A pooled connection that has exceeded its idle time will be closed and replaced when necessary by a new connection. This settings supports the
|
cas.authn.passwordless.accounts.mongo.pool.life-time=PT60S
The maximum time a pooled connection can live for. A zero value indicates no limit to the life time. A pooled connection that has exceeded its life time will be closed and replaced when necessary by a new connection. This settings supports the
|
cas.authn.passwordless.accounts.mongo.pool.max-size=10
Maximum number of connections to keep around.
|
cas.authn.passwordless.accounts.mongo.pool.max-wait-time=PT60S
The maximum time that a thread may wait for a connection to become available. This settings supports the
|
cas.authn.passwordless.accounts.mongo.pool.min-size=1
Minimum number of connections to keep around.
|
cas.authn.passwordless.accounts.mongo.pool.per-host=10
Total number of connections allowed per host.
|
cas.authn.passwordless.accounts.rest.basic-auth-password=
If REST endpoint is protected via basic authentication, specify the password for authentication.
|
cas.authn.passwordless.accounts.rest.basic-auth-username=
If REST endpoint is protected via basic authentication, specify the username for authentication.
|
cas.authn.passwordless.accounts.rest.headers=
Headers, defined as a Map, to include in the request when making the REST call. Will overwrite any header that CAS is pre-defined to send and include in the request. Key in the map should be the header name and the value in the map should be the header value.
|
cas.authn.passwordless.accounts.rest.method=GET
HTTP method to use when contacting the rest endpoint. Examples include
|
cas.authn.passwordless.accounts.simple=
Passwordless authentication settings using static accounts. The key is the user identifier, while the value is the form of contact such as email, sms, etc.
|
cas.authn.passwordless.accounts.ldap.allow-multiple-dns=false
Whether search/query results are allowed to match on multiple DNs, or whether a single unique DN is expected for the result.
|
cas.authn.passwordless.accounts.ldap.allow-multiple-entries=false
Set if multiple Entries are allowed.
|
cas.authn.passwordless.accounts.ldap.binary-attributes=
Indicate the collection of attributes that are to be tagged and processed as binary attributes by the underlying search resolver.
|
cas.authn.passwordless.accounts.ldap.block-wait-time=PT3S
The length of time the pool will block. By default the pool will block indefinitely and there is no guarantee that waiting threads will be serviced in the order in which they made their request. This option should be used with a blocking connection pool when you need to control the exact number of connections that can be created This settings supports the
|
cas.authn.passwordless.accounts.ldap.connect-timeout=PT5S
Sets the maximum amount of time that connects will block. This settings supports the
|
cas.authn.passwordless.accounts.ldap.connection-strategy=
If multiple URLs are provided as the ldapURL this describes how each URL will be processed.
|
cas.authn.passwordless.accounts.ldap.disable-pooling=false
Whether to use a pooled connection factory in components.
|
cas.authn.passwordless.accounts.ldap.email-attribute=mail
Name of the LDAP attribute that indicates the user's email address.
|
cas.authn.passwordless.accounts.ldap.fail-fast=true
Attempt to populate the connection pool early on startup and fail quickly if something goes wrong.
|
cas.authn.passwordless.accounts.ldap.follow-referrals=true
Set if search referrals should be followed.
|
cas.authn.passwordless.accounts.ldap.hostname-verifier=DEFAULT
Hostname verification options. Available values are as follows:
|
cas.authn.passwordless.accounts.ldap.idle-time=PT10M
Removes connections from the pool based on how long they have been idle in the available queue. Prunes connections that have been idle for more than the indicated amount. This settings supports the
|
cas.authn.passwordless.accounts.ldap.keystore=
Path to the keystore used for SSL connections. Typically contains SSL certificates for the LDAP server. This setting supports the Spring Expression Language.
|
cas.authn.passwordless.accounts.ldap.keystore-password=
Keystore password. This setting supports the Spring Expression Language.
|
cas.authn.passwordless.accounts.ldap.keystore-type=
The type of keystore.
|
cas.authn.passwordless.accounts.ldap.max-pool-size=10
Maximum LDAP connection pool size which the pool can use to grow.
|
cas.authn.passwordless.accounts.ldap.min-pool-size=3
Minimum LDAP connection pool size. Size the pool should be initialized to and pruned to
|
cas.authn.passwordless.accounts.ldap.name=
Name of the LDAP handler.
|
cas.authn.passwordless.accounts.ldap.name-attribute=cn
Name of the LDAP attribute that indicates the user's name.
|
cas.authn.passwordless.accounts.ldap.page-size=0
Request that the server return results in batches of a specific size. See RFC 2696. This control is often used to work around server result size limits. A negative/zero value disables paged requests.
|
cas.authn.passwordless.accounts.ldap.phone-attribute=phoneNumber
Name of the LDAP attribute that indicates the user's phone.
|
cas.authn.passwordless.accounts.ldap.pool-passivator=BIND
You may receive unexpected LDAP failures, when CAS is configured to authenticate using
|
cas.authn.passwordless.accounts.ldap.prune-period=PT2H
Removes connections from the pool based on how long they have been idle in the available queue. Run the pruning process at the indicated interval. This settings supports the
|
cas.authn.passwordless.accounts.ldap.response-timeout=PT5S
Duration of time to wait for responses. This settings supports the
|
cas.authn.passwordless.accounts.ldap.sasl-authorization-id=
SASL authorization id.
|
cas.authn.passwordless.accounts.ldap.sasl-mechanism=
The SASL mechanism.
|
cas.authn.passwordless.accounts.ldap.sasl-mutual-auth=
SASL mutual auth is enabled?
|
cas.authn.passwordless.accounts.ldap.sasl-quality-of-protection=
SASL quality of protected.
|
cas.authn.passwordless.accounts.ldap.sasl-realm=
The SASL realm.
|
cas.authn.passwordless.accounts.ldap.sasl-security-strength=
SASL security strength.
|
cas.authn.passwordless.accounts.ldap.search-entry-handlers=
Search handlers.
|
cas.authn.passwordless.accounts.ldap.subtree-search=true
Whether subtree searching is allowed.
|
cas.authn.passwordless.accounts.ldap.trust-certificates=
Path of the trust certificates to use for the SSL connection. Ignores keystore-related settings when activated and used.
|
cas.authn.passwordless.accounts.ldap.trust-manager=
Trust Manager options. Trust managers are responsible for managing the trust material that is used when making LDAP trust decisions, and for deciding whether credentials presented by a peer should be accepted. Accepted values are: *
|
cas.authn.passwordless.accounts.ldap.trust-store=
Path to the keystore used to determine which certificates or certificate authorities should be trusted. Used when connecting to an LDAP server via LDAPS or startTLS connection. If left blank, the default truststore for the Java runtime is used. This setting supports the Spring Expression Language.
|
cas.authn.passwordless.accounts.ldap.trust-store-password=
Password needed to open the truststore. This setting supports the Spring Expression Language.
|
cas.authn.passwordless.accounts.ldap.trust-store-type=
The type of trust keystore that determines which certificates or certificate authorities are trusted. Types depend on underlying java platform, typically
|
cas.authn.passwordless.accounts.ldap.use-start-tls=false
Whether TLS should be used and enabled when establishing the connection.
|
cas.authn.passwordless.accounts.ldap.validate-on-checkout=true
Whether connections should be validated when loaned out from the pool.
|
cas.authn.passwordless.accounts.ldap.validate-period=PT5M
Period at which pool should be validated. This settings supports the
|
cas.authn.passwordless.accounts.ldap.validate-periodically=true
Whether connections should be validated periodically when the pool is idle.
|
cas.authn.passwordless.accounts.ldap.validate-timeout=PT5S
Period at which validation operations may time out. This settings supports the
|
cas.authn.passwordless.accounts.mongo.authentication-database-name=
Name of the database to use for authentication.
|
cas.authn.passwordless.accounts.mongo.drop-collection=false
Whether collections should be dropped on startup and re-created.
|
cas.authn.passwordless.accounts.mongo.read-concern=AVAILABLE
Read concern. Accepted values are:
|
cas.authn.passwordless.accounts.mongo.read-preference=PRIMARY
Read preference. Accepted values are:
|
cas.authn.passwordless.accounts.mongo.replica-set=
A replica set in MongoDB is a group of
|
cas.authn.passwordless.accounts.mongo.retry-writes=false
Sets whether writes should be retried if they fail due to a network error.
|
cas.authn.passwordless.accounts.mongo.socket-keep-alive=false
Whether the database socket connection should be tagged with keep-alive.
|
cas.authn.passwordless.accounts.mongo.ssl-enabled=false
Whether connections require SSL.
|
cas.authn.passwordless.accounts.mongo.timeout=PT5S
MongoDb database connection timeout. This settings supports the
|
cas.authn.passwordless.accounts.mongo.write-concern=ACKNOWLEDGED
Write concern describes the level of acknowledgement requested from MongoDB for write operations to a standalone mongo db or to replica sets or to sharded clusters. In sharded clusters, mongo db instances will pass the write concern on to the shards.
|
LDAP Scriptable Search Filter
LDAP search filters can point to an external Groovy script to dynamically construct the final filter template.
The script itself may be designed as:
1
2
3
4
5
6
7
8
9
10
11
12
import org.ldaptive.*
import org.springframework.context.*
def run(Object[] args) {
def filter = (FilterTemplate) args[0]
def parameters = (Map) args[1]
def applicationContext = (ApplicationContext) args[2]
def logger = args[3]
logger.info("Configuring LDAP filter")
filter.setFilter("uid=something")
}
The following parameters are passed to the script:
Parameter | Description |
---|---|
filter |
FilterTemplate to be updated by the script and used for the LDAP query. |
parameters |
Map of query parameters which may be used to construct the final filter. |
applicationContext |
Reference to the Spring ApplicationContext reference. |
logger |
The object responsible for issuing log messages such as logger.info(...) . |
Configuration Metadata
The collection of configuration properties listed in this section are automatically generated from the CAS source and components that contain the actual field definitions, types, descriptions, modules, etc. This metadata may not always be 100% accurate, or could be lacking details and sufficient explanations.
Be Selective
This section is meant as a guide only. Do NOT copy/paste the entire collection of settings into your CAS configuration; rather pick only the properties that you need. Do NOT enable settings unless you are certain of their purpose and do NOT copy settings into your configuration only to keep them as reference. All these ideas lead to upgrade headaches, maintenance nightmares and premature aging.
YAGNI
Note that for nearly ALL use cases, declaring and configuring properties listed here is sufficient. You should NOT have to explicitly massage a CAS XML/Java/etc configuration file to design an authentication handler, create attribute release policies, etc. CAS at runtime will auto-configure all required changes for you. If you are unsure about the meaning of a given CAS setting, do NOT turn it on without hesitation. Review the codebase or better yet, ask questions to clarify the intended behavior.
Naming Convention
Property names can be specified in very relaxed terms. For instance cas.someProperty
, cas.some-property
, cas.some_property
are all valid names. While all
forms are accepted by CAS, there are certain components (in CAS and other frameworks used) whose activation at runtime is conditional on a property value, where
this property is required to have been specified in CAS configuration using kebab case. This is both true for properties that are owned by CAS as well as those
that might be presented to the system via an external library or framework such as Spring Boot, etc.
When possible, properties should be stored in lower-case kebab format, such as cas.property-name=value
.
The only possible exception to this rule is when naming actuator endpoints; The name of the
actuator endpoints (i.e. ssoSessions
) MUST remain in camelCase mode.
Settings and properties that are controlled by the CAS platform directly always begin with the prefix cas
. All other settings are controlled and provided
to CAS via other underlying frameworks and may have their own schemas and syntax. BE CAREFUL with
the distinction. Unrecognized properties are rejected by CAS and/or frameworks upon which CAS depends. This means if you somehow misspell a property definition
or fail to adhere to the dot-notation syntax and such, your setting is entirely refused by CAS and likely the feature it controls will never be activated in the
way you intend.
Validation
Configuration properties are automatically validated on CAS startup to report issues with configuration binding, specially if defined CAS settings cannot be
recognized or validated by the configuration schema. The validation process is on by default and can be skipped on startup using a special system
property SKIP_CONFIG_VALIDATION
that should be set to true
. Additional validation processes are also handled
via Configuration Metadata and property migrations applied automatically on
startup by Spring Boot and family.
Indexed Settings
CAS settings able to accept multiple values are typically documented with an index, such as cas.some.setting[0]=value
. The index [0]
is meant to be
incremented by the adopter to allow for distinct multiple configuration blocks.
Memory
This is the default option where tokens are kept in memory using a cache with a configurable expiration period. Needless to say, this option is not appropriate in clustered CAS deployments inside there is not a way to synchronize and replicate tokens across CAS nodes.
Others
Option | Description |
---|---|
JPA | Please see this guide. |
REST | Please see this guide. |
Custom | Please see this guide. |
Messaging & Notifications
The following settings and properties are available from the CAS configuration catalog:
cas.authn.passwordless.tokens.mail.attribute-name=mail
Principal attribute name that indicates the destination email address for this message. The attribute must already be resolved and available to the CAS principal.
|
cas.authn.passwordless.tokens.mail.from=
Email from address.
|
cas.authn.passwordless.tokens.mail.subject=
Email subject line. The subject can either be defined verbaitm, or it may point to a message key in the language bundle using the syntax#{subject-language-key} . This key should point to a valid message defined in the appropriate language bundle that is then picked up via the active locale. In case where the language code cannot resolve the real subject, a default subject value would be used.
This setting supports the Spring Expression Language.
|
cas.authn.passwordless.tokens.sms.attribute-name=phone
Principal attribute name that indicates the destination phone number for this SMS message. The attribute must already be resolved and available to the CAS principal.
|
cas.authn.passwordless.tokens.sms.from=
The from address for the message.
|
cas.authn.passwordless.tokens.sms.text=
The body of the SMS message.
|
cas.authn.passwordless.tokens.mail.bcc=
Email BCC address, if any.
|
cas.authn.passwordless.tokens.mail.cc=
Email CC address, if any.
|
cas.authn.passwordless.tokens.mail.html=false
Indicate whether the message body should be evaluated as HTML text.
|
cas.authn.passwordless.tokens.mail.priority=1
Set the priority (
|
cas.authn.passwordless.tokens.mail.reply-to=
Email Reply-To address, if any.
|
cas.authn.passwordless.tokens.mail.text=
Email message body. Could be plain text or a reference to an external file that would serve as a template. If specified as a path to an external file with an extension.gtemplate , then the email message body would be processed using the Groovy template engine. The template engine uses JSP style <% %> script and <%= %> expression syntax or GString style expressions. The variable out is bound to the writer that the template is being written to. If using plain text, the contents are processed for string subtitution candidates using named variables. For example, you may refer to an expected url variable in the email text via ${url} , or use ${token} to locate the token variable. In certain cases, additional parameters are passed to the email body processor that might include authentication and/or principal attributes, the available locale, client http information, etc.
|
cas.authn.passwordless.tokens.mail.validate-addresses=false
Set whether to validate all addresses which get passed to this helper.
|
The following settings may also need to be defined to describe the mail server settings:
spring.mail.default-encoding=UTF-8
|
spring.mail.host=
|
spring.mail.jndi-name=
Session JNDI name. When set, takes precedence over other Session settings. How can I configure this property?
|
spring.mail.password=
|
spring.mail.port=
|
spring.mail.properties=
|
spring.mail.protocol=smtp
|
spring.mail.test-connection=false
|
spring.mail.username=
|
Configuration Metadata
The collection of configuration properties listed in this section are automatically generated from the CAS source and components that contain the actual field definitions, types, descriptions, modules, etc. This metadata may not always be 100% accurate, or could be lacking details and sufficient explanations.
Be Selective
This section is meant as a guide only. Do NOT copy/paste the entire collection of settings into your CAS configuration; rather pick only the properties that you need. Do NOT enable settings unless you are certain of their purpose and do NOT copy settings into your configuration only to keep them as reference. All these ideas lead to upgrade headaches, maintenance nightmares and premature aging.
YAGNI
Note that for nearly ALL use cases, declaring and configuring properties listed here is sufficient. You should NOT have to explicitly massage a CAS XML/Java/etc configuration file to design an authentication handler, create attribute release policies, etc. CAS at runtime will auto-configure all required changes for you. If you are unsure about the meaning of a given CAS setting, do NOT turn it on without hesitation. Review the codebase or better yet, ask questions to clarify the intended behavior.
Naming Convention
Property names can be specified in very relaxed terms. For instance cas.someProperty
, cas.some-property
, cas.some_property
are all valid names. While all
forms are accepted by CAS, there are certain components (in CAS and other frameworks used) whose activation at runtime is conditional on a property value, where
this property is required to have been specified in CAS configuration using kebab case. This is both true for properties that are owned by CAS as well as those
that might be presented to the system via an external library or framework such as Spring Boot, etc.
When possible, properties should be stored in lower-case kebab format, such as cas.property-name=value
.
The only possible exception to this rule is when naming actuator endpoints; The name of the
actuator endpoints (i.e. ssoSessions
) MUST remain in camelCase mode.
Settings and properties that are controlled by the CAS platform directly always begin with the prefix cas
. All other settings are controlled and provided
to CAS via other underlying frameworks and may have their own schemas and syntax. BE CAREFUL with
the distinction. Unrecognized properties are rejected by CAS and/or frameworks upon which CAS depends. This means if you somehow misspell a property definition
or fail to adhere to the dot-notation syntax and such, your setting is entirely refused by CAS and likely the feature it controls will never be activated in the
way you intend.
Validation
Configuration properties are automatically validated on CAS startup to report issues with configuration binding, specially if defined CAS settings cannot be
recognized or validated by the configuration schema. The validation process is on by default and can be skipped on startup using a special system
property SKIP_CONFIG_VALIDATION
that should be set to true
. Additional validation processes are also handled
via Configuration Metadata and property migrations applied automatically on
startup by Spring Boot and family.
Indexed Settings
CAS settings able to accept multiple values are typically documented with an index, such as cas.some.setting[0]=value
. The index [0]
is meant to be
incremented by the adopter to allow for distinct multiple configuration blocks.
Users may be notified of tokens via text messages, mail, etc. To learn more about available options, please see this guide or this guide.
Disabling Passwordless Authentication Flow
Passwordless authentication can be disabled conditionally on a per-user basis. If
the passwordless account retrieved from the account store
carries a user whose requestPassword
is set to true
, the passwordless flow
(i.e. as described above with token generation, etc) will
be disabled and skipped in favor of the more usual CAS authentication flow,
challenging the user for a password. Support for this behavior may depend
on each individual account store implementation.
Multifactor Authentication Integration
Passwordless authentication can be integrated with CAS multifactor authentication providers. In this scenario, once CAS configuration is enabled to support this behavior via settings or the located passwordless user account is considered eligible for multifactor authentication, CAS will allow passwordless authentication to skip its own intended normal flow (i.e. as described above with token generation, etc) in favor of multifactor authentication providers that may be available and defined in CAS.
This means that if multifactor authentication providers are defined and activated, and defined multifactor triggers in CAS signal availability and eligibility of an multifactor flow for the given passwordless user, CAS will skip its normal passwordless authentication flow in favor of the requested multifactor authentication provider and its flow. If no multifactor providers are available, or if no triggers require the use of multifactor authentication for the verified passwordless user, passwordless authentication flow will commence as usual.
Delegated Authentication Integration
Passwordless authentication can be integrated with CAS delegated authentication. In this scenario, once CAS configuration is enabled to support this behavior via settings or the located passwordless user account is considered eligible for delegated authentication, CAS will allow passwordless authentication to skip its own intended normal flow (i.e. as described above with token generation, etc) in favor of delegated authentication that may be available and defined in CAS.
This means that if delegated authentication providers are defined and activated, CAS will skip its normal passwordless authentication flow in favor of the requested multifactor authentication provider and its flow. If no delegated identity providers are available, passwordless authentication flow will commence as usual.
The selection of a delegated authentication identity provider for a passwordless user is handled using a script. The script may be defined as such:
1
2
3
4
5
6
7
8
9
10
def run(Object[] args) {
def passwordlessUser = args[0]
def clients = (Set) args[1]
def httpServletRequest = args[2]
def logger = args[3]
logger.info("Testing username $passwordlessUser")
clients[0]
}
The parameters passed are as follows:
Parameter | Description |
---|---|
passwordlessUser |
The object representing the PasswordlessUserAccount . |
clients |
The object representing the collection of identity provider configurations. |
httpServletRequest |
The object representing the http request. |
logger |
The object responsible for issuing log messages such as logger.info(...) . |
The outcome of the script can be null
to skip delegated authentication for
the user, or it could a selection from the available identity providers passed into the script.