Skip to main content

Authz Casdoor Configuration

The authz-casdoor plugin protects APISIX and API7 Gateway routes with browser-based OAuth sign-in through Casdoor. Configuration covers static settings and plugin parameters.

Static Configurations​

The plugin does not expose a shared session secret. Its session library generates a different encryption key in each gateway worker process. Configure one worker process on every gateway instance so later requests can read the session cookie.

config.yaml
nginx_config:
worker_processes: 1

Reload or restart the gateway after updating config.yaml.

When multiple gateway instances serve the route, configure load-balancer affinity so a browser remains on the same instance for the complete authentication flow and session. Otherwise, a callback or later request can reach an instance that cannot read the cookie and return 503 Service Unavailable or start another sign-in flow. This requirement complicates horizontal scaling; assess it before production use.

Parameters​

See plugin common configurations for configuration options available to all plugins.

  • endpoint_addr

    string

    required

    valid value:

    An HTTP or HTTPS URL without a trailing slash or query string

    Base URL of the Casdoor server. The plugin redirects users to this address for sign-in and sends authorization-code exchanges to the same address.

    The address must be reachable by both users' browsers and every gateway instance.

  • client_id

    string

    required


    OAuth client ID of the Casdoor application registered for the gateway.

  • client_secret

    string

    required


    OAuth client secret of the Casdoor application registered for the gateway.

    API7 Gateway encrypts the value with AES at rest. APISIX encrypts it before etcd storage when apisix.data_encryption.enable_encrypt_fields is enabled.

  • callback_url

    string

    required

    valid value:

    An HTTP or HTTPS URL without a trailing slash or query string

    Absolute URL where Casdoor returns the browser after authorization. Configure the same URL as a redirect URI on the Casdoor application.

    The callback path must be matched by a route on which this plugin is configured.