🚀 Feature: allow to set artbitrary Cliend-ID #231

Closed
opened 2025-10-07 00:06:40 +03:00 by OVERLORD · 9 comments
Owner

Originally created by @savely-krasovsky on GitHub.

Feature description

Currently you cannot do it, since Pocket-ID automatically generates random UUID. Unfortunately there are apps which require to create exact Client IDs to work. Excellent example is OpenCloud: their desktop and mobile app has hard-coded IDs which they list in the doc: https://docs.opencloud.eu/docs/admin/configuration/authentication-and-user-management/external-idp

Pitch

It will allow to support some setups I described above.

Originally created by @savely-krasovsky on GitHub. ### Feature description Currently you cannot do it, since Pocket-ID automatically generates random UUID. Unfortunately there are apps which require to create exact Client IDs to work. Excellent example is OpenCloud: their desktop and mobile app has hard-coded IDs which they list in the doc: https://docs.opencloud.eu/docs/admin/configuration/authentication-and-user-management/external-idp ### Pitch It will allow to support some setups I described above.
OVERLORD added the open to pull requests label 2025-10-07 00:06:40 +03:00
Author
Owner

@stonith404 commented on GitHub:

Fair enough. For mobile applications this would make sense.

@stonith404 commented on GitHub: Fair enough. For mobile applications this would make sense.
Author
Owner

@savely-krasovsky commented on GitHub:

Client registration will work, but it's more enterprise setup in my opinion. It's much simpler to just allow arbitrary Client-ID. In my case it works flawlessly.

@savely-krasovsky commented on GitHub: Client registration will work, but it's more enterprise setup in my opinion. It's much simpler to just allow arbitrary Client-ID. In my case it works flawlessly.
Author
Owner

@stonith404 commented on GitHub:

It's recommended that the client ID is random:

Even though it’s public, it’s best that it isn’t guessable by third parties, so many implementations use something like a 32-character hex string. If the client ID is guessable, it makes it slightly easier to craft phishing attacks against arbitrary applications. It must also be unique across all clients that the authorization server handles.

In my opinion this is a wrong implementation on Opencloud's side, client IDs shouldn't be set manually. If you really have to set a custom client ID, you have to do it manually in the database.

@stonith404 commented on GitHub: It's [recommended](https://www.oauth.com/oauth2-servers/client-registration/client-id-secret/) that the client ID is random: > Even though it’s public, it’s best that it isn’t guessable by third parties, so many implementations use something like a 32-character hex string. If the client ID is guessable, it makes it slightly easier to craft phishing attacks against arbitrary applications. It must also be unique across all clients that the authorization server handles. In my opinion this is a wrong implementation on Opencloud's side, client IDs shouldn't be set manually. If you really have to set a custom client ID, you have to [do it manually in the database](https://github.com/pocket-id/pocket-id/issues/83#issuecomment-2565226796).
Author
Owner

@savely-krasovsky commented on GitHub:

In my opinion this is a wrong implementation on Opencloud's side, client IDs shouldn't be set manually. If you really have to set a custom client ID.

@stonith404 I agree, though you usually cannot change Client-ID which is hard-coded into mobile applications. Making it configurable in app's UI? Questionable, it should rather use OAuth 2.0 Dynamic Client Registration Protocol which Pocket-ID is also doesn't support AFAIK. It seems reasonable for mobile applications at least, IMO.

Database trick is the first thing I did, hopefully Pocket-ID didn't have any strict requirements.

@savely-krasovsky commented on GitHub: > In my opinion this is a wrong implementation on Opencloud's side, client IDs shouldn't be set manually. If you really have to set a custom client ID. @stonith404 I agree, though you usually cannot change Client-ID which is hard-coded into mobile applications. Making it configurable in app's UI? Questionable, it should rather use [OAuth 2.0 Dynamic Client Registration Protocol](https://datatracker.ietf.org/doc/html/rfc7591) which Pocket-ID is also doesn't support AFAIK. It seems reasonable for mobile applications at least, IMO. Database trick is the first thing I did, hopefully Pocket-ID didn't have any strict requirements.
Author
Owner

@BEBU88 commented on GitHub:

I'm also interested in setting up Opencloud Clients. I just read that all of their clients support Dynamic Client Registration: https://github.com/opencloud-eu/desktop/issues/246#issuecomment-2857476676

@BEBU88 commented on GitHub: I'm also interested in setting up Opencloud Clients. I just read that all of their clients support Dynamic Client Registration: https://github.com/opencloud-eu/desktop/issues/246#issuecomment-2857476676
Author
Owner

@Tarow commented on GitHub:

In addition to the client_id, itd be great if we can also set the client_secret.

This would allow declarative provisioning of OIDC clients in PocketID and configuration of the clients itself (say Traefik).
Would be very handy when using the Rest API directly or through the Terraform Provider for example.

@Tarow commented on GitHub: In addition to the client_id, itd be great if we can also set the client_secret. This would allow declarative provisioning of OIDC clients in PocketID and configuration of the clients itself (say Traefik). Would be very handy when using the Rest API directly or through the Terraform Provider for example.
Author
Owner

@kmendell commented on GitHub:

@MorrisMorrison Feel free to implement what you think would work, but keep in mind the goal of our UI. "To stay simple" we dont want to clutter it up that much. If you try this we can always tweak the UI to make sure it stays simple.

@kmendell commented on GitHub: @MorrisMorrison Feel free to implement what you think would work, but keep in mind the goal of our UI. "To stay simple" we dont want to clutter it up that much. If you try this we can always tweak the UI to make sure it stays simple.
Author
Owner

@MorrisMorrison commented on GitHub:

Hi,
I would like to take a look at this feature.

How do we want to display this option in the UI?
I was thinking about adding a simple toggle "Auto-generate ClientID" to the oidc-client form in settings, which is always true by default. Once turned off, we display a text input to be able to set an arbitrary client id.
Looking at the current layout it would probably fit nicely next to the name input.
We could also move it to the advanced options, since it's primarily needed for specific integration scenarios rather than typical usage.

@MorrisMorrison commented on GitHub: Hi, I would like to take a look at this feature. How do we want to display this option in the UI? I was thinking about adding a simple toggle "Auto-generate ClientID" to the oidc-client form in settings, which is always true by default. Once turned off, we display a text input to be able to set an arbitrary client id. Looking at the current layout it would probably fit nicely next to the name input. We could also move it to the advanced options, since it's primarily needed for specific integration scenarios rather than typical usage.
Author
Owner

@kmendell commented on GitHub:

@MorrisMorrison Thinking more it should probably go in the advanced options, thats a good call.

@kmendell commented on GitHub: @MorrisMorrison Thinking more it should probably go in the advanced options, thats a good call.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id#231