mirror of
https://github.com/plankanban/planka.git
synced 2026-02-05 00:39:58 +03:00
[Bug]: Can't Access the HTTP API when using OIDC #784
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Lappun0 on GitHub (Aug 12, 2025).
Where is the problem occurring?
I encountered the problem while interacting with the server (Backend)
What browsers are you seeing the problem on?
Chrome
Current behavior
API requests like https://planka.example.com/api/projects and so on return the following message even when requested with valid access tokens from the frontend:
{"code":"E_UNAUTHORIZED","message":"Access token is missing, invalid or expired"}
Desired behavior
API requests return proper data when supplied with a working token from an OIDC authenticated browser
Steps to reproduce
curl -X GET https://planka.example.com/api/projects
-H "Content-Type: application/json"
-H "Authorization: Bearer "
Other information
Im on docker running version 2.0.0-rc.3 of PLANKA. Im not sure if im missing something maybe related to PLANKA 2.0 or if this is an actual bug, any help is appreciated.
@meltyshev commented on GitHub (Aug 13, 2025):
Hey! The error occurs because we use two tokens in browsers for extra security - an
accessTokenwhich you send in theAuthorizationheader, and anhttpOnlyTokenwhich is set as anhttpOnlycookie. This combination helps prevent CSRF attacks, since you must set theAuthorizationheader manually, and if youraccessTokenis stolen (for example, via an XSS attack) - it can't be used to authorize requests without thehttpOnlyToken.As a temporary workaround, if possible, try using another non-SSO user and log in via the API without the
withHttpOnlyToken=trueparameter. This way, you'll receive anaccessTokenthat can be used alone to access the API. Alternatively, you could try reading thehttpOnlyTokenfrom cookies and sending it along as well.There's already a pull request to implement per-user API keys, so in the future you won't need to use the
accessTokenat all.@Lappun0 commented on GitHub (Aug 16, 2025):
Ah okay I understand. I tried your suggested workaround and it works perfectly fine for reading some data from my boards. Since there is already a pull request in the works for this to be reworked, I'm going to close this issue for now.