Support for OpenID connect
It would be nice for Rocket.Chat to support OpenID Connect
This seams to become the new standard for SSO to remote servers.
We would love to have a PR for that :)
I think then I should create something in packages But there're two things I could not figure out:
- where do I put the settings (and support multiple entries)
- how do the packages in the above folder get loaded
I never developed something with meteor, so it kinda has a steep learning curve.
The settings I probably need are:
- Client ID
- Authorize URL
- Scopes to request
- UserInfo URL
@svrooij that's right, you should put your code inside packages folder.
What do you mean by it needs to support multiple entries?
After you add your code to the packages folder, you must edit the .meteor/packages file and add yours there.
You can get inspired by these packages: rocketchat-piwik and rocketchat-cas. Both packages show how to add stuff to settings and how to use files on server / client side.
Thank you for your help.
@marceloschmidt With multiple entries I mean that OpenID Connect is an extension on top op OAuth2. And if we (me or someone else) would implement OpenID Connect you could have multiple providers. So at this moment you provide multiple custom oauth providers, that could also be the case with multiple OpenId Connect providers.
In fact I think it could be a choice when adding a Custom OAuth provider. It is either OAuth2 or OpenID Connect. because most properties are identical.
OpenID Connect works with a discovery document sample that is always at the same url /.well-known/openid-configuration their any client can get the correct urls. So it is like OAuth2 authentication with auto configuration.
@svrooij Just curious where things are. Any chance any progress have been made on this?
Thanks.
Any update on this? If not I would be interested in picking it up.
Hi, I'm not sure to understand this query, today we can use an openID Connect provider for rocket.chat. For example we use keycloak connected to several directory (LDAP) and rocket.chat is connected to keycloak to delegate identification through oauth (we didn't succeed in using SAML though...). Is there a point I am missing ?
Hi, I'm not sure to understand this query, today we can use an openID Connect provider for rocket.chat. For example we use keycloak connected to several directory (LDAP) and rocket.chat is connected to keycloak to delegate identification through oauth (we didn't succeed in using SAML though...). Is there a point I am missing ?
I'm currently trying to get rocket.chat working with Keycloak. I've managed to get keycloak login page, as well as successful login (I can see active session in Keycloak admin console for rocket.chat client). But I keep resieving "internal server error" pop on rocket.chat login page :/ Do you have any tips/tricks which I should check out?
@bakhtizin hi, one most obvious error could be the redirect url, you should check that keycloak has the right one (rocket.Chat provide it to you). Linked to that I had to put a local reverse proxy (so the url wouldn't be with the port), and I had to mess up with the SELinux (permissive). Hope it helps.
@fcoppolani thank you for the idea. I'll try out the trick with reverse proxy.
So, how can this be accomplished?
We are successfully running Rocket.Chat with keycloak and OpenID Connect in a production environment.
Our client settings in keycloak:
Consent-required: off
Accss-type: confidential
Standard-flow enabled: on
Impicit-flow enabled: on
Valid Redirect URIs: http://localhost/_oauth/myidentityprovidername , http://mychatserver.org/_oauth/myidentityprovidername
Oauth settings in Rocket.Chat:
URL: https://myidentityprovider.org/auth
Token path: /realms/myrealm/protocol/openid-connect/token
Identity path: /realms/myrealm/protocol/openid-connect/userinfo
Auth path: /realms/myrealm/protocol/openid-connect/auth
Area: openid
Token sent via: head line
ID: as provided by ield username: keycloak
Secret: as provided by keycloak
Field Username: preferred_username
@gjsman take a look at https://github.com/RocketChat/Rocket.Chat/issues/7418
@bakhtizin Interesting. The thing is I would like to avoid using Keycloak if possible (saves server memory), but no other OpenID providers seem to work. I've tried Auth0.com, the WordPress plugin, all fail with the same, weird error for me:
�[34mI20171014-22:03:42.724(0) Exception while invoking method 'login' SyntaxError: Unexpected token < at Object.parse (native) at CustomOAuth.getAccessToken (/snap/rocketchat-server/1142/programs/server/packages/rocketchat_custom-oauth.js:166:17) at Object.handleOauthRequest (/snap/rocketchat-server/1142/programs/server/packages/rocketchat_custom-oauth.js:224:28) at OAuth._requestHandlers.(anonymous function) (packages/oauth2.js:27:31) at middleware (packages/oauth.js:203:5) at packages/oauth.js:176:5
@gjsman it hints that there is somehting going out of hand with token parsing, maybe checking out how the providers named by you deliver the access tokens can help you out
Why would it affect three different providers though? It looks more like a Rocket.Chat issue than a provider issue...
I will try.
I've tested with drupal and gitlab a while back and that worked as a charm. (Provided you know how to setup opened connect) there are even some helper functions present in Rocket Chat to help set it up.
@svrooij do we have any implicit flow implementation for the openid connect. Currently the whole oauth setup in Rocket.Chat expect a code in the query string while with implicit flow it returns token in the url hash. You can further read about implicit flow on the link http://openid.net/specs/openid-connect-implicit-1_0.html#ImplicitFlow
Hello guys. Did anyone manage to make Rocket.Chat work with Keycloak. I have put in the configurations used by @rasos but it's not working. The login screen that I see is for Rocket.Chat it never reaches the Keycloak login screen. And when I try to login, there is no call that goes to Keycloak from Rocket.Chat.
@bakhtizin could you assist