Skip to content

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.

  • A running Zitadel instance (self-hosted or cloud)
  • Admin access to create projects, applications, and service users
  • Shoehorn deployed with Helm
  1. Log in to the Zitadel console
  2. Navigate to Projects > Create Project
  3. Name it (e.g., “Shoehorn”)
  4. Note the Project ID from the project details page
  1. In the project, click New Application
  2. Select Web as the application type
  3. Under Redirect URIs, add https://<your-domain>/api/v1/auth/callback
  4. Under Post Logout URIs, add https://<your-domain>/. Keep the trailing slash: Shoehorn sends it, and Zitadel needs an exact match.
  5. Note the Client ID

A service user enables server-to-server communication for team and group synchronization.

  1. Navigate to Users > Service Users > New
  2. Create a service user (e.g., “shoehorn-sync”)
  3. Generate a Personal Access Token (PAT)
  4. Grant the service user access to the project:
    • Go to the project
    • Under Authorizations, add the service user

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.

Set these environment variables:

Terminal window
AUTH_PROVIDER=zitadel
ZITADEL_URL=http://zitadel:8080 # Internal URL (cluster-internal)
ZITADEL_EXTERNAL_URL=https://auth.example.com # Browser-accessible URL
ZITADEL_PROJECT_ID=349308689758290610
ZITADEL_CLIENT_ID=349310449335993010
ZITADEL_SERVICE_USER_PAT=your-pat-here # For team sync

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):

Terminal window
kubectl create secret generic shoehorn-credentials \
--from-literal=zitadel_service_user_pat="your-pat-here" \
# ...plus the other keys from the chart README

Then reference it from values:

auth:
zitadel:
serviceUserPatSecretRef:
key: zitadel_service_user_pat

The 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.

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.

  1. In the project, New Application, type User Agent or Native
  2. Authentication method: PKCE, no secret
  3. Redirect URI: http://localhost:8080/callback
  4. Turn on Development Mode, or Zitadel rejects the plain-HTTP loopback address MCP clients use
  5. On Token Settings, set Auth Token Type to JWT
  6. 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: 8080

Then point a client at it:

Terminal window
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 shoehorn

add-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.

With the service user PAT configured, Shoehorn can synchronize groups from Zitadel into teams.

  1. Shoehorn queries the Zitadel API for organization groups
  2. Groups are matched to Shoehorn teams via group mappings
  3. When a user logs in, their group memberships update their Shoehorn team assignments

Map a Zitadel group to a Shoehorn team:

Terminal window
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.

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.

If you use Zitadel alongside other identity providers, enable OrgData sync:

auth:
orgdata:
enabled: true
providers: ["zitadel", "okta"]
primaryProvider: "zitadel" # Conflict resolution priority

When multiple providers are enabled:

  • Users are deduplicated by email
  • Teams are deduplicated by name
  • The primary provider wins conflicts
Terminal window
AUTH_ENCRYPTION_KEY=$(openssl rand -hex 32) # Required in production
SESSION_MAX_AGE=8h # Session validity (default: 8h)
CSRF_ENABLED=true # CSRF protection

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.

Login redirects to a blank page

  • Verify ZITADEL_EXTERNAL_URL is 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/debug endpoint 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