Skip to main content

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:

config.yaml
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

    integer

    default: 67108864

    valid value:

    greater than or equal to 1

    Maximum 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

    string

    required


    Base URI of the CAS 2.0 identity provider. The plugin appends /login, /serviceValidate, or /logout for the corresponding operation.

  • cas_callback_uri

    string

    required


    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

    string

    required


    Request path that starts service provider-initiated logout. Configure a path matched by the protected route.

  • cookie

    object

    required


    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

      string

      required

      valid value:

      at least 32 characters

      Secret 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

      boolean

      default: true


      If true, add the Secure attribute to cookies issued by the plugin. Set to false only when the protected route uses HTTP, such as in a local test environment.

    • samesite

      string

      default: Lax

      valid value:

      Lax or None

      Value of the SameSite attribute on cookies issued by the plugin. Strict is not supported because it prevents the identity provider redirect from returning the initiation cookie.

      Setting this field to None requires secure to be true.