[Bug]: Cosmos Server OIDC & Audiobookshelf Error #2087

Closed
opened 2026-04-25 00:03:22 +02:00 by adam · 3 comments
Owner

Originally created by @mandopatriot on GitHub (Jul 7, 2024).

What happened?

ERROR: "[Auth] Error in openid callback - OPError: invalid_client (Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method).)" (Auth.js:564)

Getting this error when trying to auth into Audiobookshelf via Cosmos Server (https://github.com/azukaar/Cosmos-Server). In Cosmos, I configured a new client with ID abs and redirect https://mydomain/auth/openid/callback,https://mydomain/auth/openid/mobile-redirect (issue is the same if I only include the web redirect). I copy the secret and set client ID and secret in Audiobookshelf. I use https://mydomain/.well-known/openid-configuration to autopopulate the URLs. I match existing by email and set Auto Register, but leaving at default produces same issue.

Once saving, I use a different browser that has history deleted, open private tab, and navigate to Audiobookshelf. I choose Login with OAuth, login to Cosmos Server, and choose to include email. Regardless if this is a new user or an existing one, I see the above log for each auth attempt. I've tried different client ID and secrets, same issue.

I ran the OpenID Debugger (https://openidconnect.net/) by setting up a new client and everything comes back valid, so it appears my identify provider is working correctly.

What did you expect to happen?

Successful auth to Audiobookshelf via OpenID.

Steps to reproduce the issue

  1. Create client and secret in Cosmos Server.
  2. Enable OpenID in Audiobookshelf and set values.
  3. Test and confirm error.

Audiobookshelf version

2.10.1

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

None

Logs

No response

Additional Notes

No response

Originally created by @mandopatriot on GitHub (Jul 7, 2024). ### What happened? ERROR: "[Auth] Error in openid callback - OPError: invalid_client (Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method).)" (Auth.js:564) Getting this error when trying to auth into Audiobookshelf via Cosmos Server (https://github.com/azukaar/Cosmos-Server). In Cosmos, I configured a new client with ID abs and redirect https://mydomain/auth/openid/callback,https://mydomain/auth/openid/mobile-redirect (issue is the same if I only include the web redirect). I copy the secret and set client ID and secret in Audiobookshelf. I use https://mydomain/.well-known/openid-configuration to autopopulate the URLs. I match existing by email and set Auto Register, but leaving at default produces same issue. Once saving, I use a different browser that has history deleted, open private tab, and navigate to Audiobookshelf. I choose Login with OAuth, login to Cosmos Server, and choose to include email. Regardless if this is a new user or an existing one, I see the above log for each auth attempt. I've tried different client ID and secrets, same issue. I ran the OpenID Debugger (https://openidconnect.net/) by setting up a new client and everything comes back valid, so it appears my identify provider is working correctly. ### What did you expect to happen? Successful auth to Audiobookshelf via OpenID. ### Steps to reproduce the issue 1. Create client and secret in Cosmos Server. 2. Enable OpenID in Audiobookshelf and set values. 3. Test and confirm error. ### Audiobookshelf version 2.10.1 ### How are you running audiobookshelf? Docker ### What OS is your Audiobookshelf server hosted from? Linux ### If the issue is being seen in the UI, what browsers are you seeing the problem on? None ### Logs _No response_ ### Additional Notes _No response_
adam added the bug label 2026-04-25 00:03:22 +02:00
adam closed this issue 2026-04-25 00:03:22 +02:00
Author
Owner

@advplyr commented on GitHub (Jul 7, 2024):

Have you tried resetting the server since you saved your OIDC settings?

@advplyr commented on GitHub (Jul 7, 2024): Have you tried resetting the server since you saved your OIDC settings?
Author
Owner

@mandopatriot commented on GitHub (Jul 7, 2024):

Have you tried resetting the server since you saved your OIDC settings?

Thank you! That progressed further and I got a new error that my issuer URL was wrong. I still had https://mydomain/.well-known/openid-configuration as the Issuer. Once I changed that to https://mydomain and restarted the container again everything worked great.

@mandopatriot commented on GitHub (Jul 7, 2024): > Have you tried resetting the server since you saved your OIDC settings? Thank you! That progressed further and I got a new error that my issuer URL was wrong. I still had https://mydomain/.well-known/openid-configuration as the Issuer. Once I changed that to https://mydomain and restarted the container again everything worked great.
Author
Owner

@mandopatriot commented on GitHub (Jul 7, 2024):

Meant to close, thanks @advplyr

@mandopatriot commented on GitHub (Jul 7, 2024): Meant to close, thanks @advplyr
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2087