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.
- Host or Docker
- API7 Gateway Helm
- APISIX Helm
nginx_config:
worker_processes: 1
Reload or restart the gateway after updating config.yaml.
nginx:
workerProcesses: 1
Apply the values through the gateway release's normal Helm upgrade workflow.
apisix:
nginx:
workerProcesses: 1
Apply the values through the APISIX release's normal Helm upgrade workflow.
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
valid value:
An HTTP or HTTPS URL without a trailing slash or query stringBase 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
OAuth client ID of the Casdoor application registered for the gateway.
client_secret
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_fieldsis enabled.callback_url
valid value:
An HTTP or HTTPS URL without a trailing slash or query stringAbsolute 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.