Skip to main content

Integrate with Rocket.chat

Support level: Community

What is Rocket.chat

Rocket.Chat is an open-source fully customizable communications platform developed in JavaScript for organizations with high standards of data protection. It is licensed under the MIT License with some other licenses mixed in. See Rocket.chat GitHub for licensing information.

-- https://github.com/RocketChat/Rocket.Chat

note

This is based on authentik 2022.3.1 and Rocket.chat 4.5.1 using the Docker-Compose install. Instructions may differ between versions.

Preparation

The following placeholders are used in this guide:

  • rocket.company is the FQDN of Rocket.chat installation.
  • authentik.company is the FQDN of authentik installation.
note

This documentation lists only the settings that you need to change from their default values. Be aware that any changes other than those explicitly mentioned in this guide could cause issues accessing your application.

authentik configuration

To support the integration of Rocket.chat with authentik, you need to create an application/provider pair in authentik.

Create an application and provider in authentik

  1. Log in to authentik as an admin, and open the authentik Admin interface.
  2. Navigate to Applications > Applications and click Create with Provider to create an application and provider pair. (Alternatively you can first create a provider separately, then create the application and connect it with the provider.)
  • Application: provide a descriptive name, an optional group for the type of application, the policy engine mode, and optional UI settings.
  • Choose a Provider type: select OAuth2/OpenID Connect as the provider type.
  • Configure the Provider: provide a name (or accept the auto-provided name), the authorization flow to use for this provider, and the following required configurations.
    • Note the Client ID,Client Secret, and slug values because they will be required later.
    • Set a Strict redirect URI to https://rocket.company/_oauth/authentik.
    • Select any available signing key.
  • Configure Bindings (optional): you can create a binding (policy, group, or user) to manage the listing and access to applications on a user's My applications page.
  1. Click Submit to save the new application and provider.

Rocket.chat configuration

note

Only settings that have been modified from default have been listed.

You may have different settings for some of the group and role mapping for advanced configurations. The settings below are the base settings to connect authentik and Rocket.chat.

In Rocket.chat, follow the procedure below:

  1. Log in as a System Administrator, click on your avatar, and choose Administration

  2. Scroll down and click on OAuth

  3. In the top right corner, click Add custom oauth

  4. Give your new oauth the name of Authentik, then click Send

  1. Scroll down to the new OAuth application, expand the dropdown, and enter the following settings:

    • Enable: Turn the radio button to the on position
    • URL: https://authentik.company/application/o
    • Token Path: /token/
    • Token Sent Via: Payload
    • Identity Token Sent Via: Same as "Token Sent Via"
    • Identity Path: /userinfo/
    • Authorize Path: /authorize/
    • Scope: email profile openid
    • Param Name for access token: access_token
    • Id: THIS IS THE CLIENT ID YOU COPIED FROM STEP 1 in authentik
    • Secret: THIS IS THE CLIENT SECRET YOU COPIED FROM STEP 1 in authentik
    • Login Style: Redirect
    • Button Text: Fill in with what you want the SSO button to say
    • Button Text Color: Hex Color for Text on the SSO login button
    • Button Color: Hex Color for the SSO login button
    • Key Field: Username
    • Username field: preferred_username
    • Email field: email
    • Name field: name
    • Roles/Groups field name: groups
    • Roles/Groups field for channel mapping: groups
    • User Data Group Map: rocket.cat
    • Merge users: Turn the radio button to the on position
    • Show Button on Login Page: Turn the radio button to the on position

  2. Click Save changes in the top right corner of the screen

Step 4 (Optional)

note

By default, Rocket.chat will attempt to use two-factor authentication with any new user coming in to the system and allows users to change their information

To disable changing user information and other options inside Rocket.chat:

Navigate to the Accounts settings to change the following:

  • Allow Name Change: Off
  • Allow Username Change: Off
  • Allow Email Change: Off
  • Allow Password Change for OAuth Users: Off

If you are using Two Factor authentication through authentik:

Navigate to the Accounts settings, Scroll Down to Two Factor Authentication and turn off Enable Two Factor Authentication

Registration Options Navigate to the Accounts settings, Scroll Down to Registration and choose your registration options, such as:

  • Registration Form: Disabled