[Bug]: Redirect URI Does Not Include Non-Standard Port in OpenID Connect Authentication #2689

Closed
opened 2026-04-25 00:09:39 +02:00 by adam · 0 comments
Owner

Originally created by @Next-Page-Vi on GitHub (Mar 26, 2025).

What happened?

When configuring OpenID Connect (OIDC) authentication with a non-standard port (e.g., https://audiobookshelf.sample.com:10443/), the redirect URI generated by Audiobookshelf does not include the port number. For example, it returns https://audiobookshelf.sample.com/auth/openid/callback instead of the expected https://audiobookshelf.sample.com:10443/auth/openid/callback. This causes a "Redirect URI Error" in the OIDC provider (e.g., Authentik), as the redirect URI does not match the configured value.

What did you expect to happen?

The redirect URI should include the non-standard port, e.g., https://audiobookshelf.sample.com:10443/auth/openid/callback.

Steps to reproduce the issue

  1. Deploy Audiobookshelf with a non-standard port, e.g., https://audiobookshelf.sample.com:10443/.
  2. Configure OIDC in Settings > Authentication with a valid Issuer URL, Client ID, and Client Secret.
  3. Attempt to log in using OIDC.
  4. Observe the redirect URI in the browser or OIDC provider logs.

Audiobookshelf version

2.20.0

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


Additional Notes

No response

Originally created by @Next-Page-Vi on GitHub (Mar 26, 2025). ### What happened? When configuring OpenID Connect (OIDC) authentication with a non-standard port (e.g., https://audiobookshelf.sample.com:10443/), the redirect URI generated by Audiobookshelf does not include the port number. For example, it returns https://audiobookshelf.sample.com/auth/openid/callback instead of the expected https://audiobookshelf.sample.com:10443/auth/openid/callback. This causes a "Redirect URI Error" in the OIDC provider (e.g., Authentik), as the redirect URI does not match the configured value. ### What did you expect to happen? The redirect URI should include the non-standard port, e.g., https://audiobookshelf.sample.com:10443/auth/openid/callback. ### Steps to reproduce the issue 1. Deploy Audiobookshelf with a non-standard port, e.g., https://audiobookshelf.sample.com:10443/. 2. Configure OIDC in Settings > Authentication with a valid Issuer URL, Client ID, and Client Secret. 3. Attempt to log in using OIDC. 4. Observe the redirect URI in the browser or OIDC provider logs. ### Audiobookshelf version 2.20.0 ### 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 ```shell ``` ### Additional Notes _No response_
adam added the bug label 2026-04-25 00:09:39 +02:00
adam closed this issue 2026-04-25 00:09:39 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2689