eclipse-che / che

Kubernetes based Cloud Development Environments for Enterprise Teams
http://eclipse.org/che
Eclipse Public License 2.0
6.99k stars 1.19k forks source link

Look at Keycloak lightweight alternatives for local development #10998

Closed l0rd closed 4 years ago

l0rd commented 6 years ago

Running Keycloak takes 500MB+ (in the documentation we ask users to allocate 1GB). That can be annoying when running multi user Che locally and can be a blocker to drop Che single user support #10996.

In this issue we want to discuss some alternatives for running Che locally (where Keycloak full feature set is useless). For example replacing Keycloak with other OIDC providers that use less resources.

cc @skabashnyuk @davidfestal

skabashnyuk commented 6 years ago

what about https://github.com/coreos/dex with etcd or SQL backend?

davidfestal commented 6 years ago

FYI I'm currently testing with https://github.com/panva/node-oidc-provider/ with upstream Che running inside Minishift

Was able to pass the authentication / token retrieval step, and I'm now coping with fixed redirect urls, which should be done quite soon.

I'll give more details about it when my tests are finished / fully successful.

l0rd commented 6 years ago

@skabashnyuk 👍 . @davidfestal has already started to look at node-oidc-provider, we can look at a couple of others alternatives and decide what is the best option.

davidfestal commented 6 years ago

Just one point about the node-oidc-provider: when running in a POD on a nodeJS 8 POD (based on the service catalog image), it only take 39 MB memory.

l0rd commented 6 years ago

In the decision we need to take into account:

skabashnyuk commented 6 years ago

https://github.com/coreos/dex Apache2, 2471 stars, 511 likes

ps x -o rss,vsz,command | grep config-dev.yaml
 17448  4426988 ./bin/dex serve examples/config-dev.yaml

I asume it's about 4meg.

davidfestal commented 6 years ago

@skabashnyuk nice !

davidfestal commented 6 years ago

I can test dex as well very easily with the same setup I currently use to test node-oidc-provider

skabashnyuk commented 6 years ago

@davidfestal you right. My numbers worth nothing if dex can't be easily integrated with che.

benoitf commented 6 years ago

https://github.com/ory/hydra https://hub.docker.com/r/oryd/hydra/

davidfestal commented 6 years ago

@benoitf yes, I quickly looked into hydra a bit already, but was a bit stopped by this sentence:

Hydra is not an identity provider (user sign up, user log in, password reset flow), but connects to your existing identity provider through a consent app. Implementing the consent app in a different language is easy, and exemplary consent apps

davidfestal commented 6 years ago

However that's a solution we could explore as well

davidfestal commented 6 years ago

about the dex possibility, I just saw that dex doesn't support the userinfo endpoint, that is used by Che to retrieve the profile from Keycloak (of from the OIDC provider). That might be a blocker I assume.

benoitf commented 6 years ago

@davidfestal about Hydra there is another repo for the consent stuff https://github.com/ory/hydra-login-consent-node

davidfestal commented 6 years ago

interesting.

davidfestal commented 6 years ago

OTOH hydra doesn't seem to be in the list of certified providers: http://openid.net/developers/certified/

benoitf commented 6 years ago

I see Hydra there http://openid.net/certification/ ? (among a long list)

davidfestal commented 6 years ago

OK, strange that it is not in the other list.

davidfestal commented 6 years ago

Another point in the hydra FAQ (https://www.ory.sh/docs/guides/master/hydra/8-faq/#is-jwt-supported):

Is JWT supported?

Mufid @mufid 03:29 Could Hydra's Access Token be a JWT? So that my resource server does not need to call Introspection API for each request.

Mufid @mufid 03:39 Yes, the access token looks like JWT, but i am unable to decode it. Here is my example token form Hydra: LpxuGoqWy7lYp9N0Cea8mEGR6IHhyr37jxZXRHqSjRM.nU-jMnAJ7dUKQPjWF4QBEL9OQWVU8zj_ElhrT-FQrWw (JWT Tokens should have 2 dots (3 segments), so this is not a valid JWT)

Mufid @mufid 03:56 *form --> from, typo, sorry. Aeneas @arekkas 11:50 @mufid JWT is not supported at the moment, we might add it, but not as part of the hydra community edition

It seems that access token cannot be returned as JWT tokens, which is still a pre-requisite of Che milited support for alternate OIDC providers: (see the Using an alternate OIDC provider instead of Keycloak section in https://www.eclipse.org/che/docs/openshift-config.html#multi-user-using-own-keycloak-and-psql)

davidfestal commented 6 years ago

Finally I have a POC of upstream Che integrated with a node-oidc-provider.

Here is a video that explains how it was setup and shows a demo of it running: https://youtu.be/UQQNACvb52k

Let me summarize the content:

sleshchenko commented 6 years ago

@davidfestal I have an issue with opening demo by the following link https://youtu.be/UQQNACvb52k screenshot_20180907_102944 Does it work for you?

skabashnyuk commented 6 years ago

@sleshchenko I have the same issue

davidfestal commented 6 years ago

@skabashnyuk @sleshchenko sorry, it had kept it in private mode. Just shared it, so you should be able to see it now.

garagatyi commented 5 years ago

@davidfestal is this issue still actual?

cccanderson commented 5 years ago

Just offering a possibility- have you looked at using OpenLiberty https://openliberty.io as the OIDC provider? It has an extremely small footprint. It is listed on https://openid.net/certification/ (but there was an important fix that went into 19.0.0.1 for an OIDC issue, so please use 19.0.0.1 or later).

Disclaimer- I work for IBM, but I am not part of the OpenLiberty team.

l0rd commented 5 years ago

@davidfestal do you remember if you had investigated OpenLiberty at the time?

davidfestal commented 5 years ago

@l0rd No I had not. I assume that now we could also look into Java-based options, especially if they would support compilation to native through graalvm or quarkus.io.

l0rd commented 5 years ago

https://news.ycombinator.com/item?id=20326931

che-bot commented 4 years ago

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.