openhab / openhab-core

Core framework of openHAB
https://www.openhab.org/
Eclipse Public License 2.0
928 stars 428 forks source link

Support for OIDC / oauth2 third-party identity provider #2277

Open farfade opened 3 years ago

farfade commented 3 years ago

Hello,

I'd like to be able to make openhab3 trust a third-party identity provider instead of only relying on its own internal identity provider.

My feeling is that the hard part of the job has already been done (supporting oauth2 for the REST API).

Regards,

farfade

ghys commented 3 years ago

Not sure exactly what you're after, but basically I see two possible approaches:

Since the internal IdP isn't OIDC compliant due to constraints like mandatory HTTPS that are not the norm for openHAB installations, standards like OIDC Federation 1.0 cannot be implemented easily. However support for OIDC (including the discovery part) as a trusted issuer of assertions in the second scenario could be, provided these constraints are not a problem in your use case.

farfade commented 3 years ago

Wow, I see your ideas are clearer than mine !

Actually my use-case is about single-sign-on :

I eventually ended-up in thinking that OIDC and oauth2 are the most promising techs to do that (with you secondary approach for openhab, and supporting also more elaborated things like authorization delegation, as roles like admin and user started to appear).

hmerk commented 3 years ago

Isn‘t this completely against the approach of having a „Intranet of things“ ? openHAB should mainly run without the need of having a working internet connection, but this request creates a dependency on that. I would agree if it is seen in context with myopenHAB remote access, but not for pure local access. Just my 2 cents.

farfade commented 3 years ago

Actually it does not. An identity provider can be self-hosted, just as anything else.

And offering a feature does not mean it is mandatory to use it : as ghys told it, openhab already implements a basic identity provider. The feature would just let guys that want to replace it by another one do it (with a self-hosted one or a "cloud" one).

To me, it is a self-contained identity provider that does not make sense : you cannot reuse the identity stored in it :)