[GH-ISSUE #3317] Invalid client_id parameter value message when trying to access new-admin interface #1832

Closed
opened 2026-02-27 11:19:22 +03:00 by kerem · 18 comments
Owner

Originally created by @mirtouf on GitHub (Sep 13, 2024).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/3317

Hi, here is my setup

  • OS Type: Debian
  • OS Version: 11
  • Database Type: MariaDB
  • Database version: 10.5.23
  • Modoboa: 2.3.2
  • installer used: No
  • Webserver: Nginx

Steps to reproduce

Try to access new-admin

Current behavior

The oauth challenge is giving an error straight in the web browser:
Error: invalid_request
Invalid client_id parameter value.

No other loading errors from the browser have been seen

Expected behavior

Access to new admin

I used to try new-admin when it was released with modoboa 2.0.0 but since then I have not been using it. I upgraded modoboa regularly following the instructions including the ones for new-admin and I cannot access the updated interface. As far as I remember it was working with modoboa 2.0.0.
I copied the settings.json from my venv and I updated the URL without modifying the OAUTH_CLIENT_ID parameter.
It could have been a topic for modoboa-users ML but the spam made it closed.

Is there a way to check elsewhere the OAUTH_CLIENT_ID value ?

Originally created by @mirtouf on GitHub (Sep 13, 2024). Original GitHub issue: https://github.com/modoboa/modoboa/issues/3317 Hi, here is my setup * OS Type: Debian * OS Version: 11 * Database Type: MariaDB * Database version: 10.5.23 * Modoboa: 2.3.2 * installer used: No * Webserver: Nginx # Steps to reproduce Try to access new-admin # Current behavior The oauth challenge is giving an error straight in the web browser: _Error: invalid_request Invalid client_id parameter value._ No other loading errors from the browser have been seen # Expected behavior Access to new admin I used to try new-admin when it was released with modoboa 2.0.0 but since then I have not been using it. I upgraded modoboa regularly following the instructions including the ones for new-admin and I cannot access the updated interface. As far as I remember it was working with modoboa 2.0.0. I copied the settings.json from my venv and I updated the URL without modifying the OAUTH_CLIENT_ID parameter. It could have been a topic for modoboa-users ML but the spam made it closed. Is there a way to check elsewhere the OAUTH_CLIENT_ID value ?
kerem 2026-02-27 11:19:22 +03:00
Author
Owner

@mirtouf commented on GitHub (Sep 13, 2024):

Is it possible that I missed a step during a migration ?

<!-- gh-comment-id:2349950641 --> @mirtouf commented on GitHub (Sep 13, 2024): Is it possible that I missed a step during a migration ?
Author
Owner

@tonioo commented on GitHub (Oct 8, 2024):

@mirtouf Sorry for the delay. Are you still encountering this issue?

<!-- gh-comment-id:2399934657 --> @tonioo commented on GitHub (Oct 8, 2024): @mirtouf Sorry for the delay. Are you still encountering this issue?
Author
Owner

@mirtouf commented on GitHub (Oct 8, 2024):

Hello,
indeed I still have the issue. Is it possible to debug the new-admin interface like the historical one ?

Are the steps still correct:
cd <modoboa_instance_dir>
cp frontend/config.json ./
rm -rf frontend
cp -R <virtuenv_path>/lib/pythonX.X/site-packages/modoboa/frontend_dist/ frontend/
cp ./config.json frontend/config.json
and change API_BASE_URL ?

<!-- gh-comment-id:2400182965 --> @mirtouf commented on GitHub (Oct 8, 2024): Hello, indeed I still have the issue. Is it possible to debug the new-admin interface like the historical one ? Are the steps still correct: `cd <modoboa_instance_dir>` `cp frontend/config.json ./` `rm -rf frontend` `cp -R <virtuenv_path>/lib/pythonX.X/site-packages/modoboa/frontend_dist/ frontend/` `cp ./config.json frontend/config.json` and change API_BASE_URL ?
Author
Owner

@tonioo commented on GitHub (Oct 9, 2024):

Have you updated the config.json file ?

<!-- gh-comment-id:2401502849 --> @tonioo commented on GitHub (Oct 9, 2024): Have you updated the config.json file ?
Author
Owner

@tonioo commented on GitHub (Oct 16, 2024):

@mirtouf up

<!-- gh-comment-id:2416589817 --> @tonioo commented on GitHub (Oct 16, 2024): @mirtouf up
Author
Owner

@mirtouf commented on GitHub (Oct 16, 2024):

Hi,
I do have updated the config.json file. Is there a way to confirm the value of OAUTH_CLIENT_ID variable?

<!-- gh-comment-id:2417047329 --> @mirtouf commented on GitHub (Oct 16, 2024): Hi, I do have updated the config.json file. Is there a way to confirm the value of OAUTH_CLIENT_ID variable?
Author
Owner

@tonioo commented on GitHub (Oct 16, 2024):

You need to look at the DB, there is a table containing all oauth2 apps

<!-- gh-comment-id:2417194350 --> @tonioo commented on GitHub (Oct 16, 2024): You need to look at the DB, there is a table containing all oauth2 apps
Author
Owner

@egelhaus commented on GitHub (Oct 23, 2024):

Hi, im also having this Issue at trying to access the new Admin UI, can someone help me?

<!-- gh-comment-id:2432601425 --> @egelhaus commented on GitHub (Oct 23, 2024): Hi, im also having this Issue at trying to access the new Admin UI, can someone help me?
Author
Owner

@Spitfireap commented on GitHub (Oct 31, 2024):

Can you try this : python manage.py load_initial_data ? It should fill config.json

<!-- gh-comment-id:2449469809 --> @Spitfireap commented on GitHub (Oct 31, 2024): Can you try this : `python manage.py load_initial_data` ? It should fill `config.json`
Author
Owner

@egelhaus commented on GitHub (Nov 1, 2024):

@Spitfireap I'll try.
In which Directory do I have to run this?

<!-- gh-comment-id:2452710663 --> @egelhaus commented on GitHub (Nov 1, 2024): @Spitfireap I'll try. In which Directory do I have to run this?
Author
Owner

@tonioo commented on GitHub (Nov 27, 2024):

@egelhaus In /srv/modoboa/instance for a regular installation. I suggest you read this section of the documentation first: https://modoboa.readthedocs.io/en/latest/upgrade.html#modoboa

<!-- gh-comment-id:2503425292 --> @tonioo commented on GitHub (Nov 27, 2024): @egelhaus In /srv/modoboa/instance for a regular installation. I suggest you read this section of the documentation first: https://modoboa.readthedocs.io/en/latest/upgrade.html#modoboa
Author
Owner

@Spitfireap commented on GitHub (Dec 21, 2024):

up @egelhaus, @mirtouf

<!-- gh-comment-id:2558164220 --> @Spitfireap commented on GitHub (Dec 21, 2024): up @egelhaus, @mirtouf
Author
Owner

@mirtouf commented on GitHub (Dec 21, 2024):

Hi @Spitfireap ,

I was lacking time past month, so I will dig first week of January and I will provide you with details.

<!-- gh-comment-id:2558181384 --> @mirtouf commented on GitHub (Dec 21, 2024): Hi @Spitfireap , I was lacking time past month, so I will dig first week of January and I will provide you with details.
Author
Owner

@stale[bot] commented on GitHub (Feb 25, 2025):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

<!-- gh-comment-id:2680007536 --> @stale[bot] commented on GitHub (Feb 25, 2025): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Author
Owner

@mirtouf commented on GitHub (Apr 15, 2025):

I managed to get this empty page after checking the OAUTH_CLIENT_ID value just before the new error:
Error: invalid_request

Mismatching redirect URI.

Image

I do not know how to handle the js errors in the console.

My config.json looks-like:
{ "API_BASE_URL": "/api/v2/", "API_DOC_URL": "/api/schema-v2/swagger/", "OAUTH_AUTHORITY_URL": "https://mail-admin.mirtouf.fr/api/o", "OAUTH_CLIENT_ID": "1234567r-2a03-4efh-b489-fc6c3c0d8c5e", "OAUTH_REDIRECT_URI": "https://mail-admin.mirtouf.fr/new-admin/login/logged", "OAUTH_POST_REDIRECT_URI": "https://mail-admin.mirtouf.fr/new-admin" }

In the fronted_dist folder from the venv, this one was generated when I updated to modoboa 2.3.2:
{ "API_BASE_URL": "/api/v2/", "API_DOC_URL": "/api/schema-v2/swagger/", "OAUTH_AUTHORITY_URL": "https://localhost:8000/api/o", "OAUTH_CLIENT_ID": "LVQbfIIX3khWR3nDvix1u9yEGHZUxcx53bhJ7FlD", "OAUTH_REDIRECT_URI": "https://localhost:3000/login/logged", "OAUTH_POST_REDIRECT_URI": "https://localhost:3000/" }

So, why is the OAUTH_CLIENT_ID not the correct value ?

<!-- gh-comment-id:2807293481 --> @mirtouf commented on GitHub (Apr 15, 2025): I managed to get this empty page after checking the OAUTH_CLIENT_ID value just before the new error: Error: invalid_request Mismatching redirect URI. ![Image](https://github.com/user-attachments/assets/90eae1c9-1cdd-47df-935b-c8728282ed19) I do not know how to handle the js errors in the console. My config.json looks-like: `{ "API_BASE_URL": "/api/v2/", "API_DOC_URL": "/api/schema-v2/swagger/", "OAUTH_AUTHORITY_URL": "https://mail-admin.mirtouf.fr/api/o", "OAUTH_CLIENT_ID": "1234567r-2a03-4efh-b489-fc6c3c0d8c5e", "OAUTH_REDIRECT_URI": "https://mail-admin.mirtouf.fr/new-admin/login/logged", "OAUTH_POST_REDIRECT_URI": "https://mail-admin.mirtouf.fr/new-admin" }` In the fronted_dist folder from the venv, this one was generated when I updated to modoboa 2.3.2: `{ "API_BASE_URL": "/api/v2/", "API_DOC_URL": "/api/schema-v2/swagger/", "OAUTH_AUTHORITY_URL": "https://localhost:8000/api/o", "OAUTH_CLIENT_ID": "LVQbfIIX3khWR3nDvix1u9yEGHZUxcx53bhJ7FlD", "OAUTH_REDIRECT_URI": "https://localhost:3000/login/logged", "OAUTH_POST_REDIRECT_URI": "https://localhost:3000/" }` So, why is the OAUTH_CLIENT_ID not the correct value ?
Author
Owner

@mirtouf commented on GitHub (Apr 16, 2025):

I am also reading #3377 to have another feedback.

<!-- gh-comment-id:2808698603 --> @mirtouf commented on GitHub (Apr 16, 2025): I am also reading #3377 to have another feedback.
Author
Owner

@mirtouf commented on GitHub (Apr 16, 2025):

Can you try this : python manage.py load_initial_data ? It should fill config.json

Is python manage.py load_initial_data the sole command to update the config.json file ?

<!-- gh-comment-id:2808836814 --> @mirtouf commented on GitHub (Apr 16, 2025): > Can you try this : `python manage.py load_initial_data` ? It should fill `config.json` Is python manage.py load_initial_data the sole command to update the config.json file ?
Author
Owner

@mirtouf commented on GitHub (Apr 16, 2025):

Found the culprit, in the table oauth2_provider_application, the rows redirect_uris and post_logout_redirect_uris have to be consistent with the json file.
In my case, I had to change years ago the fqdn for the modoboa app while keeping the old fqdn for my mail address, I see where it is coming from.

<!-- gh-comment-id:2809031363 --> @mirtouf commented on GitHub (Apr 16, 2025): Found the culprit, in the table oauth2_provider_application, the rows redirect_uris and post_logout_redirect_uris have to be consistent with the json file. In my case, I had to change years ago the fqdn for the modoboa app while keeping the old fqdn for my mail address, I see where it is coming from.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#1832
No description provided.