Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Keycloak OpenID Custom Provider

Open dayio opened this issue 10 years ago • 0 comments

Your Rocket.Chat version: latest

Hello ! i've got one error trying to set up an opensource identity server for rocket.chat the provider is Keycloak.

the error i've got is Exception while invoking method 'login' Error: Service data for service keycloak must include id

As i've seen on a previous issue #3580 this is an easy fix i think, the payload is :

{
  "jti": "da62a1.......5333f687",
  "exp": 1477496365,
  "nbf": 0,
  "iat": 1477495465,
  "iss": "http://auth.server/auth/realms/myrealm",
  "aud": "rocketchat",
  "sub": "8cab5a51-8e02-45ca-a160-f414c502bc09", // this is the user ID on keycloak
  "typ": "Bearer",
  "azp": "rocketchat",
  "nonce": "a86348......7a96ae",
  "session_state": "a8a.......c25a",
  "client_session": "3bf0....5748",
  "allowed-origins": [
    "*"
  ],
  "resource_access": {
    .....
  },
  "name": "Alex Name",
  "preferred_username": "alex_name",
  "given_name": "Alex ",
  "family_name": "Name",
  "email": "[email protected]"
}

the userId is sub and the username is preferred_username i've made updates in the code at L115 and L155 rocketchat-custom-oauth/custom_oauth_server.coffee

and i would like to know if my updates are legit for a PR or if someone has a solution !

Thanks !

dayio avatar Oct 27 '16 14:10 dayio