🚀 Feature: Manually set Client ID and Client Secret #438

Closed
opened 2025-10-08 00:08:37 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @varialflip on GitHub.

Feature description

Editing the Client ID and Secret

Pitch

I'm currently trying to setup Pocket ID as my IDP for OwnCloud. However it requires a hard coded Client ID and Secret to use the mobile and desktop clients.

Originally created by @varialflip on GitHub. ### Feature description Editing the Client ID and Secret ### Pitch I'm currently trying to setup Pocket ID as my IDP for OwnCloud. However it requires a hard coded Client ID and Secret to use the mobile and desktop clients.
OVERLORD added the feature label 2025-10-08 00:08:37 +03:00
Author
Owner

@stonith404 commented on GitHub:

Yeah the docs are indeed a bit confusing. As far as I understand you either have to use the hard-coded client ID and secret or hard-code the credentials provided by Pocket ID into the source code of the OwnCloud clients and rebuild the app:

The desktop and mobile apps (clients) have a default client ID and secret hard-coded, which are used for ownCloud’s oauth2 app. When using Kopano as IdP, it does not pre-define a client ID and secret. You can use the default ones of the client to configure Kopano properly. With some IdPs like MS-Azure, these and other required parameters come from the IdP and must be coded into the client. Note that each IdP has different requirements. Get in touch with ownCloud for a branding subscription to customize the clients according to your needs.

If you choose to use a hard-coded client secret, it inherently becomes insecure since the secret is no longer private. For this reason, I’ve decided not to implement the ability to set your own client ID and secret directly.

That said, if you still want to proceed with this insecure approach, you can manually update the client ID and secret in the database with the following commands:

cd path-to-pocket-id

docker compose exec pocket-id apk add sqlite
docker compose exec pocket-id sqlite3 backend/data/pocket-id.db "UPDATE oidc_clients SET id='owncloud-client-id', secret='owncloud-client-secret-bcrypt-hashed' WHERE id='current-client-id';"

Here’s how to replace the placeholders:

  • Replace owncloud-client-id with the desired client ID.
  • Replace owncloud-client-secret-bcrypt-hashed with the bcrypt-hashed version of the client secret you want to use. To generate this hash, visit https://bcrypt-generator.com/, input your client secret, and use the resulting hash.
  • Replace current-client-id with the client ID of the existing client you want to update.
@stonith404 commented on GitHub: Yeah the docs are indeed a bit confusing. As far as I understand you either have to use the hard-coded client ID and secret or hard-code the credentials provided by Pocket ID into the source code of the OwnCloud clients and rebuild the app: > The desktop and mobile apps (clients) have a default client ID and secret hard-coded, which are used for ownCloud’s oauth2 app. When using Kopano as IdP, it does not pre-define a client ID and secret. You can use the default ones of the client to configure Kopano properly. With some IdPs like MS-Azure, these and other required parameters come from the IdP and must be coded into the client. Note that each IdP has different requirements. Get in touch with ownCloud for a branding subscription to customize the clients according to your needs. If you choose to use a hard-coded client secret, it inherently becomes insecure since the secret is no longer private. For this reason, I’ve decided not to implement the ability to set your own client ID and secret directly. That said, if you still want to proceed with this insecure approach, you can manually update the client ID and secret in the database with the following commands: ```bash cd path-to-pocket-id docker compose exec pocket-id apk add sqlite docker compose exec pocket-id sqlite3 backend/data/pocket-id.db "UPDATE oidc_clients SET id='owncloud-client-id', secret='owncloud-client-secret-bcrypt-hashed' WHERE id='current-client-id';" ``` Here’s how to replace the placeholders: - Replace `owncloud-client-id` with the desired client ID. - Replace `owncloud-client-secret-bcrypt-hashed` with the bcrypt-hashed version of the client secret you want to use. To generate this hash, visit https://bcrypt-generator.com/, input your client secret, and use the resulting hash. - Replace `current-client-id` with the client ID of the existing client you want to update.
Author
Owner

@etho201 commented on GitHub:

Thank you @stonith404 for providing details on how to work around the issue. As I implemented this in my own setup, I documented the steps I took: https://github.com/etho201/docker-pi-stacks/blob/master/dev/pocket-id/owncloud.md

@etho201 commented on GitHub: Thank you @stonith404 for providing details on how to work around the issue. As I implemented this in my own setup, I documented the steps I took: https://github.com/etho201/docker-pi-stacks/blob/master/dev/pocket-id/owncloud.md
Author
Owner

@varialflip commented on GitHub:

Owncloud docs have been hard for me to understand.
Here’s the relevant information:
https://doc.owncloud.com/server/next/admin_manual/configuration/user/oidc/oidc.html#client-ids-secrets-and-redirect-uris

This applies to Owncloud server (not ocis) but I believe the clients are the same.

@varialflip commented on GitHub: Owncloud docs have been hard for me to understand. Here’s the relevant information: https://doc.owncloud.com/server/next/admin_manual/configuration/user/oidc/oidc.html#client-ids-secrets-and-redirect-uris This applies to Owncloud server (not ocis) but I believe the clients are the same.
Author
Owner

@stonith404 commented on GitHub:

Are you sure that you have to set the client ID and client secret manually? Can you share where you've read that?

@stonith404 commented on GitHub: Are you sure that you have to set the client ID and client secret manually? Can you share where you've read that?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id-pocket-id-1#438