Configuring Keycloak Identity Provider
Create a client in Keycloak.
- Provide a client ID:
- Select the client protocol as openid-connect
- Select the client access type as confidential
- Standard flow implemented: ON
- Valid Redirect URL:
The following image shows the minimal configurations needed to setup Keycloak as an Identity Provider to Rocket.Chat.
After saving the changes a new credentials tab will be created for the client. This credentials tab will provide the client secrets which will be used when configuring the Rocket.Chat
Create a Custom Oauth provider
- Login to Rocket.Chat with an administrator account and navigate to OAuth page.
- Click the Add custom OAuth button and provide the following configurations
The URL paths provided in the below configurations can be also obtained by navigating to the Realm setting and
clicking the endpoints link in the
General Tab. While configuring the below settings replace the
the appropriate realm name. The default realm provided by Keycloak is
- Token Path:
- Token sent via: Header
- Identity Token Sent Via: Same As “Token Sent Via”
- Identity Path
- Authorize Path
- Param Name for access token:
- Id: This is the id of the Rocket.Chat client created in the keycloak
- Secret: Secret key provided in the credentials tab when creating the Rocket.Chat client
- Button Text:
Login with Keycloak
Leave the rest of the configurations as default.
Now logout from Rocket.Chat to view the keycloak based login option visible in the login page.