CAS Auth Configuration
The cas-auth plugin protects routes with CAS 2.0 single sign-on, validates service tickets, manages sessions, and supports single logout. Configuration covers static settings and plugin parameters.
Static Configurations
The plugin stores authenticated sessions in the cas_sessions NGINX shared dictionary. Its capacity is configured with the cas-auth entry under nginx_config.http.lua_shared_dict and defaults to 10 MB:
nginx_config:
http:
lua_shared_dict:
cas-auth: 10m
Changing the dictionary size requires restarting the gateway. Each gateway instance has its own dictionary; session records are not replicated between instances.
Parameters
See plugin common configurations for configuration options available to all plugins.
max_req_body_size
valid value:
greater than or equal to 1Maximum single logout callback body size, in bytes, that the plugin buffers in memory. A larger request is rejected.
Introduced in API7 Enterprise 3.9.17 and 3.10.4, and in APISIX 3.21.0.
idp_uri
Base URI of the CAS 2.0 identity provider. The plugin appends
/login,/serviceValidate, or/logoutfor the corresponding operation.cas_callback_uri
Callback where the identity provider returns the browser with a service ticket and sends single logout requests. Configure a URI matched by the protected route.
An absolute URL is used as the CAS service URL without modification. For a relative path, the plugin builds the service URL from the request scheme, host, and port. Use an absolute URL when requests can carry an untrusted or rewritten Host header.
Absolute callback URLs were introduced in API7 Enterprise 3.9.14 and 3.10.0, and in APISIX 3.21.0.
logout_uri
Request path that starts service provider-initiated logout. Configure a path matched by the protected route.
cookie
Settings for cookies issued during the CAS authentication flow.
Introduced in API7 Enterprise 3.9.13 and 3.10.0, and in APISIX 3.21.0.
secret
valid value:
at least 32 charactersSecret used to sign the cookie that preserves the original request URI during authentication. Use the same value on every gateway instance that serves the protected route.
The value is encrypted before being stored in the configuration store.
secure
If true, add the
Secureattribute to cookies issued by the plugin. Set to false only when the protected route uses HTTP, such as in a local test environment.samesite
valid value:
LaxorNoneValue of the
SameSiteattribute on cookies issued by the plugin.Strictis not supported because it prevents the identity provider redirect from returning the initiation cookie.Setting this field to
Nonerequiressecureto be true.