You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "dosubot[bot] (via GitHub)" <gi...@apache.org> on 2026/05/02 03:21:04 UTC
Re: [D] Superset API Auth Issue (Expecting cookies instead of access_token) [superset]
GitHub user dosubot[bot] edited a comment on the discussion: Superset API Auth Issue (Expecting cookies instead of access_token)
<!-- Answer -->
The behavior you're seeing with the Superset `/api/v1/dashboard` endpoint is consistent with how authentication and permissions are implemented in Superset:
- When you call the endpoint without authentication, you only get dashboards accessible to the "Public" role.
- When you use a session cookie (from a logged-in browser session), you get all dashboards your user account has permission to see.
- The API does not always accept a Bearer access token for all endpoints or authentication flows, depending on how Superset is configured and how the token is generated.
### Why is the API expecting cookies instead of an access token?
Superset's REST API endpoints, including `/api/v1/dashboard`, are protected by authentication decorators (such as `@protect()`), which by default expect a session-based authentication (i.e., a session cookie) for most use cases. This is why using a session cookie works for accessing all dashboards, while unauthenticated requests only return dashboards available to the "Public" role [[source]](https://github.com/apache/superset/blob/master/superset/dashboards/api.py).
There is a known issue where some API endpoints only work with cookies for authentication, and using Bearer tokens does not provide the same access. This has been reported by other users as well, but there is currently no official solution or workaround documented in the repository [[source]](https://github.com/apache/superset/issues/23352).
### Public Role and Access
If the "Public" role is granted access to certain dashboards, unauthenticated requests will return those dashboards. If the "Public" role does not have access, you must authenticate as a user with the necessary permissions to see more dashboards. This is by design and aligns with Superset's security model [[source]](https://github.com/apache/superset/blob/master/docs/docs/security/security.mdx).
You can configure the permissions of the "Public" role using the `PUBLIC_ROLE_LIKE` setting in your `superset_config.py`. For example, setting `PUBLIC_ROLE_LIKE = "Gamma"` will grant the "Public" role the same permissions as the Gamma role, but you still need to explicitly grant access to specific datasets [[source]](https://github.com/apache/superset/discussions/31949).
### How to Properly Authenticate API Requests
- For full access to dashboards via the API, use a session cookie from a logged-in user session.
- If you want to use access tokens, ensure they are generated and used in a way that Superset recognizes (e.g., via OAuth or JWT, if configured). However, not all endpoints may support Bearer token authentication out of the box.
- For public/anonymous access, configure the "Public" role and its permissions as needed.
### Summary
- The API's reliance on cookies is by design for most endpoints.
- Bearer token support may be limited or require additional configuration.
- Public dashboards are controlled by the "Public" role's permissions.
- There are open issues about this authentication behavior, but no official fix yet [[source]](https://github.com/apache/superset/issues/23352).
If you need to automate dashboard access, the most reliable method is to authenticate as a user and use the session cookie in your API requests. If you need broader API token support, you may need to explore Superset's advanced authentication options or monitor related issues for updates.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*
---
Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fsuperset).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fsuperset&message_id=06db5c52-2e60-498c-bbb9-95bf6f44bd3d) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fsuperset)
GitHub link: https://github.com/apache/superset/discussions/33585#discussioncomment-13278652
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org