Skip to content

feat(oauth): support desktop-specific OIDC issuer and client_id discovery - #766

Closed
pat-s wants to merge 2 commits into
opencloud-eu:mainfrom
pat-s:feat/desktop-issuer
Closed

pat-s wants to merge 2 commits into
opencloud-eu:mainfrom
pat-s:feat/desktop-issuer

Conversation

@pat-s

@pat-s pat-s commented Dec 21, 2025 •

Copy link
Copy Markdown

fix #246

Enables identity providers that require separate OIDC clients per application type (like Authentik, Kanidm, Zitadel) to work with the desktop client.

  • Discover desktop-specific OIDC issuer via WebFinger (http://openid.net/specs/connect/1.0/issuer/desktop)
  • Use server-provided client_id from WebFinger link properties when available
  • Persist and restore client_id across re-authentication

Server-side changes

To work, this PR requires changes in https://github.com/opencloud-eu/opencloud.
A complementary PR is available at opencloud-eu/opencloud#2072.

Additionally, the following env vars must be set on the admin side:

WEBFINGER_OIDC_ISSUER_DESKTOP: <>
WEBFINGER_OIDC_CLIENT_ID_DESKTOP: <>

Here, WEBFINGER_OIDC_ISSUER_DESKTOP is usually the root URL of the identity provider and WEBFINGER_OIDC_CLIENT_ID_DESKTOP contains the client_id of the respective oAuth project.


With these changes, I was able to login into the Desktop app with a dedicated oAuth project through Zitadel (v4.7.0). The implementation should be generic and work with other oAuth providers as well.

@pat-s

pat-s commented Mar 2, 2026

Copy link
Copy Markdown
Author

After opencloud-eu/opencloud#2072 got merged: are there changes needed here? @rhafer you might know best.

It might even be needed to issue a new release in sync with v5.2.0 then to be able to make use of the new issuer behavior.

@Chanceium

Copy link
Copy Markdown

@pat-s i noticed server was merged as well for 5.2.0 but client is still requesting client id "OpenCloudDesktop" does openclouddesktop need this merge as well

@pat-s

pat-s commented Mar 10, 2026

Copy link
Copy Markdown
Author

@Chanceium Yes, changes are needed to make this work.

@Chanceium

Copy link
Copy Markdown

@Chanceium Yes, changes are needed to make this work.

Let's get this pushed 😭

@guruz

guruz commented May 7, 2026

Copy link
Copy Markdown
Contributor

Hi @pat-s I'm trying to get an overview here about the different open PRs..
Do I see it correctly that this PR is just for client_id, while the #847 (+ base PRs or whateber?) is also for scope?
CC @kaivol

@kaivol

kaivol commented May 7, 2026

Copy link
Copy Markdown
Contributor

As far as I can tell the implementations differ in some places.

For example, I would suggest that persisting the clientId (see here) is not a good idea.
Also, I'd argue that the additional restructuring in my PRs makes a lot of sense, in particular the improvement described in #776 (comment).

@guruz

guruz commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Thank you for the contribution @pat-s ...

Now #847 is merged which also supports customized scope values so this PR here is not needed anymore.

It would still be great to get testing help if #847 works for your setup.

@pat-s

pat-s commented Jul 22, 2026

Copy link
Copy Markdown
Author

@guruz I'd be happy if somebody from the team would rebase this and get it in - or any other fresh/new PR. Contributing here wasn't a great experience so far and at some point I have mainly given up pushing.

I would still be interested in using OpenCloud one day - but first this problem must be resolved.

@TheOneRing

Copy link
Copy Markdown
Contributor

Closing now that #847 is merged

@TheOneRing TheOneRing closed this Jul 22, 2026
lucas-dclrcq added a commit to lucas-dclrcq/homelabitty that referenced this pull request Aug 3, 2026
The desktop client cannot use webfinger platform client discovery (PR
opencloud-eu/desktop#766 was never merged) and authenticates with its
baked-in OpenCloudDesktop client id. Route its webfinger lookups (mirall
user agent) through a rewrite proxy sidecar that points it at the
dedicated OpenCloudDesktop Authentik issuer.

Co-Authored-By: Claude Fable 5 <[email protected]>
@guruz

guruz commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Hi all, Testing of pre-release with webfinger client_id/scope support would be appreciated.
It's installable seperately from the main version, so there should be no collision.
https://github.com/opencloud-eu/desktop/releases/tag/v4.0.0-rc.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support different OIDC issuer for desktop

5 participants