Integrations · OIDC

Rocket.Chat SSO

Configure Rocket.Chat Community or Enterprise to authenticate via Clavex using the built-in Custom OAuth provider. Covers username, email, and avatar synchronisation from Clavex claims.

Prerequisites


Step 1 — Register OIDC Client in Clavex

Admin API (curl)
$ curl -X POST https://id.acme.eu/api/v1/organizations/acme/clients \ -H 'Authorization: Bearer $ADMIN_TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "client_id": "rocketchat", "client_name": "Rocket.Chat", "grant_types": ["authorization_code", "refresh_token"], "redirect_uris": ["https://chat.acme.eu/_oauth/clavex"], "scopes": ["openid", "profile", "email"], "token_endpoint_auth_method": "client_secret_post" }'

Step 2 — Add Custom OAuth Provider in Rocket.Chat

  1. Go to AdminSettingsOAuth
  2. Click Add custom OAuth and name it clavex
  3. Configure the following settings:
    SettingValue
    EnableTrue
    URLhttps://id.acme.eu/acme
    Token path/token
    Token sent viaHeader
    Identity token sent viaHeader
    Identity path/userinfo
    Authorize path/authorize
    Scopeopenid profile email
    Param name for access tokenaccess_token
    IDrocketchat
    Secretcs_xxxxxxxxxxxxxxxx
    Login styleRedirect
    Button textSign in with Clavex
    Button text color#FFFFFF
    Button color#1D9E75

Step 3 — Configure Field Mapping

Still in the Clavex OAuth settings panel, expand Field map:

JSON field map
{ "name": "name", "email": "email", "username": "preferred_username", "avatar": "picture" }

Also enable:

Step 4 — Test

Navigate to https://chat.acme.eu and you should see a Sign in with Clavex button on the login screen.


Troubleshooting

SymptomCauseFix
Button not shown on login page OAuth provider disabled or show button setting off Enable Show button on login page in the OAuth provider settings
error_uri_mismatch Redirect URI wrong Verify Clavex has https://chat.acme.eu/_oauth/clavex in redirect_uris
Username taken error on first login Same username exists as local user Enable Merge users setting or delete/rename the conflicting local account
Avatar not syncing picture claim not present Ensure Clavex user has a profile picture; picture URL must be publicly accessible
Login loop / state error Cookie domain mismatch Ensure ROOT_URL in Rocket.Chat matches the exact domain with protocol