OpenID Connect

Your homeserver can be configured to authenticate its users with an OpenID Connect provider. Here we list the most popular providers and how to configure them.

See also Delegated Authentication for single sign-on (SSO) integration .

Authentik

In the Element Matrix Services configuration form

Gitea

In the Element Matrix Services configuration form

GitHub

For detailed information, read GitHub's guide on OpenID .

  1. Create a new application on GitHub.com .
  2. Choose a name for you and your users to recognize.
  3. Choose a homepage URL. You can pick any URL. If your company maintains a guide on how to use Matrix, this would be most helpful.
  4. The Authorization callback URL needs to be https://my-host.ems.host. Adapt the URL to match your homeserver's address. You must use your .ems.host domain, even if your server uses Custom DNS.
  5. Save and note the client ID and client secret. Those are needed when adding the OpenID Connect integration in our interface.

In the Element Matrix Services configuration form

Use the preset GitHub for a simplified form or use Custom with the following values:

GitLab

For detailed information, read GitLab's guide on OpenID .

  1. Create a new application on GitLab.com.
  2. Choose a name for you and your users to recognize.
  3. Choose a homepage URL. You can pick any URL. If your company maintains a guide on how to use Matrix, this would be most helpful.
  4. The Redirect URL needs to be https://my-host.ems.host/_synapse/client/oidc/callback. Adapt the URL to match your homeserver's address. You must use your .ems.host domain, even if your server uses Custom DNS.
  5. Check the scopes read_user, openid and profile.
  6. Save and note the client ID and client secret. Those are needed when adding the OpenID Connect integration in our interface.

To connect your own GitLab instance, simply adapt the URL path.

In the Element Matrix Services configuration form

Google

For detailed information, read Google's guide on OpenID .

  1. Create a new application on Google .
  2. Click Create credentials and OAuth client ID.
  3. Select the application type Web application.
  4. Choose a name for you and your users to recognize.
  5. Add an authorized redirect URI with your homeserver URL, like https://my-host.ems.host/_synapse/client/oidc/callback. You must use your .ems.host domain, even if your server uses Custom DNS.
  6. Save and note the client ID and client secret. Those are needed when adding the OpenID Connect integration in our interface.

In the Element Matrix Services configuration form

Use the preset Google for a simplified form or use Custom with the following values:

If you want shorter usernames and are not worried about username collisions within your domain, please consider using SAML2 to authenticate with Google.

Okta

For detailed information, read Okta's guide onOpenID .

  1. Create a new App. Sign-in method OIDC - OpenID Connect and Application type Web Application.
  2. Choose a name for you and your users to recognize.
  3. Sign-in redirect URIs: https://my-host.ems.host/_synapse/client/oidc/callback. Adapt the URL to match your homeserver's address. You must use your .ems.host domain, even if your server uses Custom DNS.
  4. Sign-out redirect URIs: https://my-host.ems.host/_synapse/client/oidc/backchannel_logout. Adapt the URL to match your homeserver's address. You must use your .ems.host domain, even if your server uses Custom DNS.

In the Element Matrix Services configuration form

Username attributes

This refers to the user's localpart in their Matrix ID (@localpart:example.com). The data provided in a minimally configured Okta user is not ideal for integration with EMS. Below are some possible configuration suggestions. All examples below use the Matrix server domain example.com.

Available values for username and display name are email (you must include email in Scopes), phone_number (you must include phone in Scopes), address, name, family_name, given_name, middle_name, nickname, preferred_username, profile, picture, website, gender, birthdate, zoneinfo,locale, and updated_at. (List updated June 8, 2023. See this document for updated information. Available options are listed in the table under "Scopes" and after the "profile" bullet under "Scope values").

Make sure all users that will be using your EMS server have the selected attributes set.

Option 1: Username attribute email. This will use the user's entire email address as their localpart. Including the domain. It will also be encoded to be compatible with Matrix. For example, email jane@example.com will become jane=40example.com:example.com. To use the email, you must also include email in Scopes.

Option 1b: We can add some logic to your OIDC config to exclude the email domain. Contact support for further details.

Option 2: Username attributes: name. This will use the user's full name from Okta. Note that spaces (and other special characters) are not supported in Matrix localparts. For example, spaces will be encoded as =20. (I.e., Jane Doe becomes @jane=20doe:example.com.

Option 2b: We can add some logic to replace spaces with for example underscore. Contact us for details.

Option 3: By default, usernames in Okta must be an email. But, if you have changed this behavior, you can set Username attributes to preferred_username to use the username.

Note, the attribute you choose for localparts does not have to be unique. But if you, for example, set Username attributes to given_name, the first Jane who sign in to your EMS server will become @jane:example.com and the second Jane becomes @jane1:example.com.

Please contact EMS Support at https://ems.element.io/support to discuss your options.


Revision #24
Created 18 April 2022 14:19:52 by Karl Abbott
Updated 27 February 2024 17:38:00 by Twilight Sparkle