[GH-ISSUE #7241] [Bug]: Node.js API authentication fails with "Invalid redirect URL" when OpenID is configured alongside password auth #44678

Open
opened 2026-04-26 06:27:33 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @carlos-otero on GitHub (Mar 20, 2026).
Original GitHub issue: https://github.com/actualbudget/actual/issues/7241

What happened?

When OpenID is configured via environment variables (ACTUAL_OPENID_*) and ACTUAL_LOGIN_METHOD=password + ACTUAL_ALLOWED_LOGIN_METHODS=password,openid are set to allow both methods, the Node.js API (@actual-app/api) fails to authenticate with password, returning Authentication failed: Invalid redirect URL.

How can we reproduce the issue?

  1. Configure OpenID via env vars (ACTUAL_OPENID_DISCOVERY_URL, ACTUAL_OPENID_CLIENT_ID, etc.)
  2. Add ACTUAL_LOGIN_METHOD=password and ACTUAL_ALLOWED_LOGIN_METHODS=password,openid
  3. Also add ACTUAL_OPENID_ENFORCE=false
  4. Try to authenticate using the Node.js API with api.init({ serverURL, password })

Expected behavior:
Password authentication should work as a fallback when ACTUAL_OPENID_ENFORCE=false and allowedLoginMethods includes password.

Actual behavior:
The server returns Authentication failed: Invalid redirect URL — the OpenID redirect flow is triggered even when explicitly requesting password auth via the Node.js API.

Workaround:
Remove all ACTUAL_OPENID_* env vars. The budget then becomes inaccessible because it was created under the OpenID user. The only working solution found was to disable OpenID entirely.

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Chrome

Operating System

Windows 11

Originally created by @carlos-otero on GitHub (Mar 20, 2026). Original GitHub issue: https://github.com/actualbudget/actual/issues/7241 ### What happened? When OpenID is configured via environment variables (ACTUAL_OPENID_*) and ACTUAL_LOGIN_METHOD=password + ACTUAL_ALLOWED_LOGIN_METHODS=password,openid are set to allow both methods, the Node.js API (@actual-app/api) fails to authenticate with password, returning Authentication failed: Invalid redirect URL. ### How can we reproduce the issue? 1. Configure OpenID via env vars (ACTUAL_OPENID_DISCOVERY_URL, ACTUAL_OPENID_CLIENT_ID, etc.) 2. Add ACTUAL_LOGIN_METHOD=password and ACTUAL_ALLOWED_LOGIN_METHODS=password,openid 3. Also add ACTUAL_OPENID_ENFORCE=false 4. Try to authenticate using the Node.js API with api.init({ serverURL, password }) Expected behavior: Password authentication should work as a fallback when ACTUAL_OPENID_ENFORCE=false and allowedLoginMethods includes password. Actual behavior: The server returns Authentication failed: Invalid redirect URL — the OpenID redirect flow is triggered even when explicitly requesting password auth via the Node.js API. Workaround: Remove all ACTUAL_OPENID_* env vars. The budget then becomes inaccessible because it was created under the OpenID user. The only working solution found was to disable OpenID entirely. ### Where are you hosting Actual? Docker ### What browsers are you seeing the problem on? Chrome ### Operating System Windows 11
GiteaMirror added the openidbug labels 2026-04-26 06:27:33 -05:00
Author
Owner

@EKCJ commented on GitHub (Apr 20, 2026):

I've set up OpenID via the web GUI and am also getting the "Invalid redirect URI" error message when trying to login with OpenID, but password login still works fine (and allows me to access my budgets or restore them from backup if necessary).

Using Authelia and v26.4.0

lmk if I can share any useful diagnostics - the container logs look unremarkable.

<!-- gh-comment-id:4283663345 --> @EKCJ commented on GitHub (Apr 20, 2026): I've set up OpenID via the web GUI and am also getting the "Invalid redirect URI" error message when trying to login with OpenID, but password login still works fine (and allows me to access my budgets or restore them from backup if necessary). Using Authelia and v26.4.0 lmk if I can share any useful diagnostics - the container logs look unremarkable.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#44678