
Kong Gateway · App integration
Protect the services behind Kong with Casdoor
The Casdoor plugin for Kong Gateway 3.x signs browsers in through Casdoor with the authorization code flow and PKCE, checks the Casdoor tokens of API calls against the JWKS, and passes the user to the upstream in X-Casdoor-User, X-Casdoor-Email and X-Casdoor-Organization headers. It runs only with a Casdoor that has a commercial edition license.
https://auth.example.com with your Casdoor address (on Casdoor Cloud, something like https://acme.casdoor.com) and the other example.com addresses with your own.Set up Kong Gateway with Casdoor
- 1
Register Kong Gateway in Casdoor
In the Casdoor console, open Applications, add an application for Kong Gateway, and on its OIDC/OAuth tab copy the Client ID and Client secret. Add these redirect URLs to Redirect URLs:
https://app.example.com/casdoor/callbackhttps://app.example.com/
- 2
Install from the Marketplace
On the Marketplace page of Casdoor, install Kong Gateway with the address of the protected site. Casdoor creates the application with the callback
/casdoor/callbackand the logout landing page as redirect URLs. Then downloadkong-plugin-casdoor-0.1.0.zipfrom the same dialog. - 3
Install the plugin on Kong
Unzip it on every Kong node, install it with LuaRocks and add
casdoorto the plugins Kong loads.cd kong-plugin-casdoor luarocks make kong-plugin-casdoor-0.1.0-1.rockspec export KONG_PLUGINS=bundled,casdoor kong restart - 4
Enable it on a service
Enable the plugin with the application's client ID and secret.
curl -X POST http://localhost:8001/services/<service>/plugins \n --data name=casdoor \n --data config.casdoor_endpoint=https://door.casdoor.com \n --data config.client_id=<client id> \n --data config.client_secret=<client secret> \n --data config.cookie_secret=<at least 32 random characters> - 5
Try it
Open the protected site in a private window: it sends you to Casdoor, and after sign-in back to the page.
/casdoor/logoutsigns you out.
Good to know
- The plugin asks Casdoor for its license every 10 minutes and answers 403 when Casdoor runs as the Community edition.
Kong Gateway settings are from its documentation as of November 2026 (Kong: Custom plugins). Kong Gateway is a trademark of its owner.
More app integrations
View allArgo CD
App integrationConnect Argo CD to Casdoor over OpenID Connect: oidc.config in argocd-cm, the client secret, PKCE, CLI login and RBAC from Casdoor groups.

DeepSeek HarnessCommercial edition
App integrationSign DeepSeek Harness in to Casdoor as an AI agent and give it the MCP servers of your organization through the Casdoor MCP gateway, with tool permissions, call records and audit, all set up from the web pages of Casdoor and DeepSeek Harness.
Gitea
App integrationAdd Casdoor to Gitea as an OpenID Connect authentication source: the add-oauth command, callback URL, and admins from a Casdoor group.
