Zitadel Integration
Zitadel is the recommended identity provider for Shoehorn. It handles authentication via OIDC, provides group claims for team mapping, and supports server-to-server team synchronization via a service user PAT.
Prerequisites
Section titled “Prerequisites”- A running Zitadel instance (self-hosted or cloud)
- Admin access to create projects, applications, and service users
- Shoehorn deployed with Helm
1. Create a Project
Section titled “1. Create a Project”- Log in to the Zitadel console
- Navigate to Projects > Create Project
- Name it (e.g., “Shoehorn”)
- Note the Project ID from the project details page
2. Create a Web Application
Section titled “2. Create a Web Application”- In the project, click New Application
- Select Web as the application type
- Under Redirect URIs, add
https://<your-domain>/api/v1/auth/callback - Under Post Logout URIs, add
https://<your-domain>/. Keep the trailing slash: Shoehorn sends it, and Zitadel needs an exact match. - Note the Client ID
3. Create a Service User
Section titled “3. Create a Service User”A service user enables server-to-server communication for team and group synchronization.
- Navigate to Users > Service Users > New
- Create a service user (e.g., “shoehorn-sync”)
- Generate a Personal Access Token (PAT)
- Grant the service user access to the project:
- Go to the project
- Under Authorizations, add the service user
4. Configure Group Claims
Section titled “4. Configure Group Claims”Zitadel includes groups in the groups JWT claim by default. No additional configuration is required.
To verify, decode a JWT token and check for the groups field.
5. Configure Shoehorn
Section titled “5. Configure Shoehorn”Set these environment variables:
AUTH_PROVIDER=zitadelZITADEL_URL=http://zitadel:8080 # Internal URL (cluster-internal)ZITADEL_EXTERNAL_URL=https://auth.example.com # Browser-accessible URLZITADEL_PROJECT_ID=349308689758290610ZITADEL_CLIENT_ID=349310449335993010ZITADEL_SERVICE_USER_PAT=your-pat-here # For team syncHelm Values
Section titled “Helm Values”The chart’s values-minimal.yaml and values-production.yaml ship with Zitadel as the auth provider. Start from either and fill in the YOUR_* markers.
The Zitadel-specific keys you’ll set:
| Path | Source |
|---|---|
auth.provider: zitadel |
required |
auth.zitadel.projectId |
Zitadel console (quote it in a values file) |
auth.zitadel.clientId |
OIDC app settings (quote it in a values file) |
auth.zitadel.externalUrl |
your Zitadel instance hostname, e.g. https://acme.zitadel.cloud |
auth.zitadel.serviceUserPatSecretRef.key |
key in your Secret holding the service-user PAT, only if you enable orgdata sync |
rbac.roleAssignment.tenantAdmin.user or .group |
a single email or Zitadel group; the matching account gets tenant:admin on first sign-in while no roles exist yet |
Create the PAT Secret (only needed for orgdata sync):
kubectl create secret generic shoehorn-credentials \ --from-literal=zitadel_service_user_pat="your-pat-here" \ # ...plus the other keys from the chart READMEThen reference it from values:
auth: zitadel: serviceUserPatSecretRef: key: zitadel_service_user_patThe chart’s schema rejects YOUR_PROJECT_ID, YOUR_CLIENT_ID, and YOUR_INSTANCE placeholders at install time with field-named errors, so the install fails fast if you forgot one.
MCP (AI Assistant) Access
Section titled “MCP (AI Assistant) Access”Connecting an AI assistant over MCP needs a second application, separate from the web app above. Create it so MCP access can be revoked on its own.
- In the project, New Application, type User Agent or Native
- Authentication method: PKCE, no secret
- Redirect URI:
http://localhost:8080/callback - Turn on Development Mode, or Zitadel rejects the plain-HTTP loopback address MCP clients use
- On Token Settings, set Auth Token Type to JWT
- Note the Client ID
The JWT setting is the one people miss. Zitadel’s default is an opaque bearer token, which Shoehorn can’t read because it verifies signatures itself rather than calling back to Zitadel. Sign-in looks like it worked and every call afterwards fails.
Give Shoehorn the client ID as well, or the setup page at /profile/mcp never offers company login:
auth: mcp: clientId: "<the Client ID from step 6>" callbackPort: 8080Then point a client at it:
claude mcp add-json --scope local shoehorn '{ "type": "http", "url": "https://shoehorn.example.com/mcp", "oauth": { "clientId": "<the Client ID from step 6>", "callbackPort": 8080, "scopes": "openid offline_access urn:zitadel:iam:org:project:id:<PROJECT_ID>:aud" }}'claude mcp login shoehornadd-json rather than add, because claude mcp add has no flag for scopes.
That last scope is the one Zitadel needs and Okta doesn’t. It’s what makes
Zitadel mint the project-ID audience Shoehorn checks for; without it sign-in
succeeds and every call afterwards is rejected. <PROJECT_ID> is the project
holding the application, not the application’s own client ID, and it’s the same
value the server has as ZITADEL_PROJECT_ID.
The callback port has to match the redirect URI in step 3.
Dynamic client registration doesn’t remove any of this. It succeeds, and then issues a token Shoehorn rejects. See MCP for why, for the other clients, and for the personal-access-token path that works without any of this setup.
Team Sync
Section titled “Team Sync”With the service user PAT configured, Shoehorn can synchronize groups from Zitadel into teams.
How It Works
Section titled “How It Works”- Shoehorn queries the Zitadel API for organization groups
- Groups are matched to Shoehorn teams via group mappings
- When a user logs in, their group memberships update their Shoehorn team assignments
Creating Group Mappings
Section titled “Creating Group Mappings”Map a Zitadel group to a Shoehorn team:
curl -X POST https://shoehorn.example.com/api/v1/admin/teams/<team-id>/group-mappings \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "group_id": "engineering-platform", "idp_provider": "zitadel" }'Or via the UI: navigate to Organization > Teams, select a team, go to the Group Mappings tab, and click Add Mapping.
The instance admin
Section titled “The instance admin”Included in v0.7.0+.
Zitadel creates one user when the instance is set up: the admin you configure Zitadel itself with. Its address sits under Zitadel’s own host, like zitadel-admin@zitadel.localhost or admin@shoehorn.zitadel.example.com, and nobody receives mail there. It isn’t a person in your directory, so Shoehorn leaves it out: the directory sync doesn’t create an account for it, it never shows on the Organization pages, in teams or in search, and a provider switch never links or removes it.
Shoehorn recognises it by two things together: it’s an instance owner in Zitadel (the IAM_OWNER role; lesser instance roles don’t count), and its email address ends with . followed by your Zitadel host. Neither is something a regular user can give themselves, so nobody can hide by changing their own address. Only accounts in the organisation Shoehorn syncs with are affected. People you create with a plain username keep their real email address and are listed as usual. If you gave the instance admin a real mailbox, it’s listed like anyone else.
For this to work, the service user Shoehorn syncs with needs to read instance administrators (the iam.member.read permission; the IAM_OWNER_VIEWER role carries it). Without it nothing is left out and Shoehorn logs a warning saying so.
The instance admin can still sign in to Shoehorn. If it has, the admin Users page shows its account with an Instance account badge so you can see it and remove it, even while it’s active. Everywhere else it stays out.
Multi-Provider Sync
Section titled “Multi-Provider Sync”If you use Zitadel alongside other identity providers, enable OrgData sync:
auth: orgdata: enabled: true providers: ["zitadel", "okta"] primaryProvider: "zitadel" # Conflict resolution priorityWhen multiple providers are enabled:
- Users are deduplicated by email
- Teams are deduplicated by name
- The primary provider wins conflicts
Session Configuration
Section titled “Session Configuration”AUTH_ENCRYPTION_KEY=$(openssl rand -hex 32) # Required in productionSESSION_MAX_AGE=8h # Session validity (default: 8h)CSRF_ENABLED=true # CSRF protectionTenant ID Strategy
Section titled “Tenant ID Strategy”The tenant comes from server configuration, not from the token. Set
ORGANIZATION_SLUG (or TENANT_ID) on the Shoehorn server and every path
uses it: web sign-in, MCP, and the API alike.
Troubleshooting
Section titled “Troubleshooting”Login redirects to a blank page
- Verify
ZITADEL_EXTERNAL_URLis browser-accessible (not an internal-only URL) - Check the redirect URI matches exactly in both Zitadel and Shoehorn
Sign-out fails with an invalid_request error about post_logout_redirect_uri
- Add
https://<your-domain>/under Post Logout URIs, trailing slash included. Zitadel needs an exact match.
Groups not appearing in JWT
- Confirm the user is a member of the group in Zitadel
- Check the service user has project access
- Decode the JWT at the
/auth/debugendpoint to inspect claims
Team sync not working
- Verify the service user PAT is valid and not expired
- Check that group mappings exist for the relevant groups
- Review API logs for sync errors
See Also
Section titled “See Also”- MCP - Connect an AI assistant, including the Zitadel setup above
- Identity Providers - Overview of all supported providers
- Group Mappings - Map IdP groups to teams
- Teams - Team creation and management
- Team Sync - Multi-provider synchronization