Repository navigation
Description
Problem
Both web and desktop clients share one issuer (OC_OIDC_ISSUER) but have different client id and redirect URI.
So the desktop app (which has its own client ID and redirect URI) fails authentication as it uses
Steps to Reproduce
- In Authentik, create two apps:
- web (ID:
web, issuerhttps://auth.domain.com/application/o/opencloud/, redirectregex: ^https:\/\/opencloud\.domain\.com\/.*$) - desktop (ID:
OpenCloudDesktop, issuerhttps://auth.domain.com/application/o/opencloud-desktop/, redirectregex: ^http:\/\/(127\.0\.0\.1|localhost).*$)
- web (ID:
- Set
OC_OIDC_ISSUERto the web URL andOC_OIDC_CLIENT_ID=web. - Set
OC_OIDC_ISSUER=https://auth.domain.com/application/o/opencloud/. - Launch the desktop app → it still uses the web issuer and client ID, and auth fails.
- uses
https://auth.domain.com/application/o/opencloud/instead ofhttps://auth.domain.com/application/o/opencloud-desktop/(expected since there is no way to configure that)
- uses
Expected
Add support for per-client overrides (e.g. DESKTOP_OIDC_ISSUER and DESKTOP_OIDC_CLIENT_ID) on the serveer so each app can point to its own OIDC endpoint if possible.
Or allow to specify the issuer directly in the desktop app instead of using the default web one.
Environment
Authentik for OIDC, Caddy reverse proxy, OpenCloud (2.0.2), OpenCloud desktop 1.0.0
Workaroud
As for now, we can simply use WEB_OIDC_CLIENT_ID=OpenCloudDesktop and use only one issuer and support both web and desktop redirect URI. This allows both the web client and desktop client uses the same issuer.
This might be more relevant to the opencloud repo instead of desktop depending on the path to solve the issue
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
micbar commentedon May 3, 2025
Maybe I am getting it wrong, but for me the issuer is auth.domain.com
From my understanding, the issuer is the server who holds the identity of a user.
In OIDC, a user should always be identifiable with
subject@issuer.Why should the issuer change from one application / client to another?
@butonic @rhafer
rhafer commentedon May 5, 2025
That seems to be some specialty of Authentik: goauthentik/authentik#7251
I don't think there is any good solution to this yes.
mrblumi commentedon May 5, 2025
It‘s not only Authentik specific- same goes for Kanidm.
K900 commentedon May 7, 2025
In addition to this, the desktop app should really pull the client ID to use from the server as well, as according to the RFC, the client ID is issued by the authorization server and doesn't have a specified format: https://www.rfc-editor.org/rfc/rfc6749#section-2.2
Meaning a compliant server may not allow setting the client ID to a known string at all, or not allow
OpenCloudDesktopas a valid ID.micbar commentedon May 7, 2025
Yes. This is called „dynamic client registration“ and works fine with our clients and providers which allow client registration. (Keycloak for example)
But most of the admins do not want client registration at all. They create specific clients with id and secret to only allow managed devices.
maxkratz commentedon May 11, 2025
Thank you for providing this workaround, @xgroleau.
Interestingly, the iOS app works correctly with the default setup described in https://docs.opencloud.eu/docs/admin/configuration/authentication-and-user-management/external-idp/.
PinkidG commentedon May 12, 2025
Interesting, for me it didn't because of a client id missmatch.
See opencloud-eu/ios#4
kaivol commentedon May 21, 2025
This workaround sadly does not work with kanidm, as client IDs are always lowercased in kanidm.
Also, I was wondering why different OIDC clients are used for the web app and the native applications at all.
If I didn't miss anything, they only differ in the redirect URIs, and it is no problem to specify multiple redirect URIs for an OIDC client.
Using only a single OIDC client would help to reduce the complexity of setting up OIDC in the identity provider.
C8opmBM commentedon Jun 5, 2025
Yes, that would be amazing to combine them as one.
I'm using Pocket ID oidc and unfortunately the clientID is automatically generated so cannot be changed.
So at the moment, I can only use one version (either web or desktop or android).
If there are any other solutions, do share.
Thanks.
LE: it seems there is a workaround to edit the client id and secret in pocketID, but somehow the other clients (desktop/android) still don't work.
mosslocker commentedon Jun 14, 2025
I am using Zitadel as my OIDC provider, and unfortunately they don't allow you to change your client ID, so I'm stuck using only the web UI. It would be great if we could allow an optional feature, where somehow the desktop & mobile apps retrieve unique per-app client ID's from your Opencloud server configuration.
C8opmBM commentedon Jun 14, 2025
Update, for anyone using pocketID, desktop client also works. See here
micbar commentedon Jun 14, 2025
@tbsbdr @db-ot
gcebollero commentedon Jul 7, 2025
I'm unable to make it work even with the workaround. My OIDC is Authentik, the same configuration that xgroleau, but OpenCloud Desktop shows "Invalid credentials" and this error appears on OpenCloud Server logs:
micbar commentedon Jul 8, 2025
Invalid issuer means your token does not match the issuer configured in the env variables for opencloud.
gcebollero commentedon Jul 9, 2025
Finally, I have been able to make the workaround work, configure both Web & Desktop client to use only the "OpenCloudDesktop" ClientID.
Would be great to implement xgroleau proposal to been able to have more than one issuer using env vars.
39 remaining items
kevinreniers commentedon Jul 19, 2026
Even when/if the desktop client gets updated to support extracting the appropriate
client_idfrom webfinger, as long as client-specific URLs aren't supported it still won't really work well with something like kanidm. Is this going to be supported?guruz commentedon Jul 22, 2026
FYI #847 was just merged (thanks @kaivol / @TheOneRing )
TheOneRing commentedon Jul 22, 2026
#847
pat-s commentedon Jul 22, 2026
Ah, I think I misunderstood the previous state. Cool to see something moving (finally)! Will try it out but apparently it already works according to the posts from others.
alvaroemtnez commentedon Jul 23, 2026
For Zitadel users: until this is released (i tried to use the appimage generated by github actions and it doesnt work, it asks for the openvfs binary which is not yet supported AFAIK), here's a simple proxy that you add to zitadel, that highjacks /oauth/v2/authorize, /oauth/v2/token and /oauth/v2/keys, so that when it detects that the client ID is OpenCloudDesktop, rewrites it to the Zitadel client ID and proxies it to the API. And also, it changes the response back to the original ID (OpenCloudDesktop) so that the desktop client doesnt complain.
Anything with a client ID different than OpenCloudDesktop is proxied normally to the zitadel API so that other apps don't break.
https://github.com/alvaroemtnez/opencloud-zitadel-api-proxy
It's completely vibe-coded but it works great for me. Don't blame me if things horribly break though :)
Edit: I must say I only tested it with the Linux appimage at the moment
Edit 2: Many thanks to the devs for solving this! :)
stratself commentedon Aug 25, 2026
Hi, does #847 actually solves the problem of having multiple issuer URLs for different platforms? I don't think it does so, and therefore still wouldn't work with Kanidm and Authentik properly.
I have also found opencloud-eu/opencloud#2072 to be relevant. Thanks for any updates.
guruz commentedon Aug 26, 2026
I recommend looking for an issue for this in opencloud repo, not desktop repo. The right people will hopefully see it there.
https://github.com/opencloud-eu/opencloud/
FYI, someone on the Matrix chat mentioned this one, maybe it helps: https://github.com/2bros-group/opencloud-oidc-webfinger-proxy
kaivol commentedon Aug 27, 2026
First, you really don't need different issuers for different platforms.
What exactly does not work for you?
I use OpenCloud without any problems with Kanidm and various platforms (web, desktop, Android). Note that the current version of the desktop client does not yet include #847, you would need to build it yourself.
MannixTT commentedon Aug 28, 2026
Since the variables already exist at the OpenCloud level, but the desktop client can't process them, I'd say it will work after that.
The web and mobile versions (Android app) already work for me, since the WebFinger parameters can already be used there.
stratself commentedon Aug 29, 2026
I would like to use different client IDs against Kanidm, rather than having them sharing a single client ID as it introduces this weakening aspect. However, Kanidm specifies each client ID to use its own separate issuer URL, and I've since learned that this problem is shared with some other IDPs including Authentik. So you can't use different IDs and have a single
OC_ISSUER_URLin this particular integration. How did you configure your Kanidm-Opencloud integration, and did you successfully use multiple client IDs?I've tried the opencloud-oidc-webfinger-proxy thing, but it doesn't seem to work against my Kanidm instance. Therefore, I've attempted this approach to hardcode some webfinger responses via my Caddy reverse proxy:
Details
Caddyfile:
While this breaks the webfinger spec, I hope it can be helpful to someone.
Thanks, I'll poke around a bit more and consider opening an issue there.
kaivol commentedon Aug 30, 2026
I believe you misunderstand what the Kanidm docs is saying there: With application they mean the whole service, not individual (web/desktop/mobile) clients for a single service. In OAuth terms, a client is An application making protected resource requests on behalf of the resource owner and with its authorization (RFC 6749).
In the documentation it says
Say, for example you share a client ID between OpenCloud and another Service X. If the latter is compromised, an attacker can use the OAuth tokens provided to Service X to access a user's OpenCloud data.
Note that this does not apply do different OpenCloud clients: If an attacker steals a token for the mobile client they can already access all files of a user. It doesn't matter if they can also do it using the desktop client (if they want to, the attacker can also simply change the Client ID of their desktop client to make it appear like a mobile client to the server).
Friendly ping to @Firstyear, maye they could clarify on this?
guruz commentedon Aug 31, 2026
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
feat(webfinger): use webfinger properties instead new relations