Open MercatoDocsSearch docsAPI reference

Enterprise

Zitadel Setup

Connect a Zitadel test user first. Set up OIDC, verify the claims Open Mercato receives on sign-in, then configure SCIM separately if Zitadel should own the lifecycle of the local user account.

This guide walks through setting up Zitadel as the identity provider for OIDC login and SCIM user provisioning in Open Mercato.

Tip · Free tier

Zitadel Cloud offers a free tier with up to 25,000 monthly active users.

1. Create a Zitadel Instance

  1. Go to https://zitadel.com and sign up for a free account
  2. Create a new instance (or use the default one)
  3. Note your instance domain: https://<instance>.zitadel.cloud

2. Create Test Users

  1. In the Zitadel Console, go to Users -> + New
  2. Fill in:
    • Username: e.g., [email protected]
    • First name / Last name
    • Email: the user's email address
    • Password: set an initial password
  3. Click Create
  4. Repeat for 2-3 test users

3. Register the OIDC Application

  1. In the Zitadel Console, go to Projects -> + New
  2. Name the project Open Mercato and click Continue
  3. Click + New Application
  4. Configure:
FieldValue
NameOpen Mercato
TypeWeb
Authentication MethodCode (PKCE)
Redirect URIshttp://localhost:3000/api/sso/callback/oidc
Post-Logout URIshttp://localhost:3000/login
  1. Click Create
  2. On the application overview, note:
    • Client ID
    • Client Secret (generate one if using Code flow)

OIDC Credentials Summary

CredentialWhere to find itValue
Issuer URLInstance domainhttps://<instance>.zitadel.cloud
Client IDApplication -> GeneralCopy from console
Client SecretApplication -> General -> GenerateCopy immediately
Redirect URIYou configured thishttp://localhost:3000/api/sso/callback/oidc

Configure Token Claims

Zitadel includes email, given_name, family_name, and email_verified in ID tokens by default when the openid, profile, and email scopes are requested. No additional configuration is needed.

Assign Users

By default, all users in the organization can access the application. To restrict access:

  1. Go to your Project -> Authorizations -> + New
  2. Select specific users or grant roles
  3. Enable "Require authorization" on the project settings if you want to restrict access

4. Create the SSO Config in Open Mercato

  1. Log into Open Mercato as admin
  2. Go to Settings -> Single Sign-On -> Create New
  3. Select OIDC as the protocol
  4. Enter:
    • Name: Zitadel
    • Issuer URL: https://<instance>.zitadel.cloud
    • Client ID: (paste from Zitadel)
    • Client Secret: (paste from Zitadel)
  5. Add allowed email domains (e.g., yourdomain.com)
  6. Test the connection (Verify Discovery)
  7. Activate the config

Verify OIDC Login

  1. Open a private/incognito browser window
  2. Go to the Open Mercato login page
  3. Enter an email address belonging to one of your test users
  4. The HRD check should detect SSO and redirect to Zitadel login
  5. Authenticate at Zitadel
  6. You should be redirected back to Open Mercato and logged in

5. Configure SCIM Provisioning

Tip · Prerequisite

Generate a SCIM bearer token from Open Mercato via the admin UI (SSO config -> Provisioning tab -> Generate Token).

Zitadel SCIM Support

Zitadel supports outbound SCIM provisioning through its Actions feature (custom workflows). Zitadel also offers a native SCIM provisioning option:

  1. Go to your Project -> Open Mercato application
  2. Navigate to Provisioning or Actions
  3. Configure SCIM outbound provisioning:
FieldValue
SCIM Base URLhttp://localhost:3000/api/sso/scim/v2 (dev) or https://<your-domain>/api/sso/scim/v2 (prod)
Bearer TokenPaste the SCIM token from Open Mercato
  1. Test the connection

Alternative: Manual/API-Based Provisioning

If Zitadel's native SCIM outbound is not available in your version, use the Zitadel Management API to sync users:

  1. Create a Service User in Zitadel with Management API access
  2. Use the Zitadel Management API to list users
  3. Push user changes to Open Mercato's SCIM endpoint

6. Test the Full Flow

Test OIDC Login

  1. Navigate to Open Mercato login
  2. Enter a test user's email
  3. Expected: Redirect to Zitadel -> authenticate -> redirect back to Open Mercato
  4. Verify the user appears in the Open Mercato admin panel

Test JIT Provisioning

If SCIM is not configured and JIT is enabled:

  1. Log in as a new user via OIDC
  2. Expected: User is automatically created in Open Mercato with provisioningMethod: jit
  3. Verify user profile (name, email) matches Zitadel

Test SCIM Provisioning (if configured)

  1. Create a new user in Zitadel
  2. Wait for provisioning cycle (or trigger manually)
  3. Expected: User appears in Open Mercato with provisioningMethod: scim
  4. Update the user in Zitadel -> verify changes propagate
  5. Deactivate the user in Zitadel -> verify deactivation in Open Mercato

Zitadel SCIM Quirks

QuirkDescriptionHow to handle
Standard-compliantZitadel follows SCIM 2.0 spec closelyStandard parsing works
email_verified claimAlways included in ID tokensNo special handling needed
Group claimsAvailable via project rolesConfigure role mappings if needed
PKCE supportNatively supports S256 PKCEAutomatically used by Open Mercato

Troubleshooting

OIDC login redirects but fails

"redirect_uri_mismatch" error

Users can't log in

SCIM connection fails

Reference

Previous: Single Sign-On (SSO)