/api/v1/me/ gives "401 Unauthorized" error even when I pass the access token in headers #29976
Replies: 2 comments 1 reply
-
Hey there, @Vinayselukar21! 👋 I'm here to help you with any bugs, questions, or contributions you have in mind. Let's tackle this together! You are getting a "401 Unauthorized" error when making a GET request to Here is the relevant test case from the document: def test_get_me_unauthorized(self):
rv = self.client.get(meUri)
self.assertEqual(401, rv.status_code) This test case shows that if the user is not authenticated, the server will respond with a 401 status code. Ensure that the access token you are passing in the headers is valid and that it is being correctly processed by the server [1]. Additionally, make sure that your WTF_CSRF_ENABLED = True
ENABLE_CORS = True
CORS_OPTIONS = {
"supports_credentials": True,
"allow_headers": "*",
"expose_headers": "*",
"resources": "*",
"origins": ["http://localhost:3000"]
} Also, ensure that you are including the headers: {
'Authorization': `Bearer ${accessToken}`,
'X-CSRFToken': csrfToken
} These configurations collectively influence how authentication is handled for API requests in Superset [2][3]. |
Beta Was this translation helpful? Give feedback.
-
I'm facing the exact same issue. |
Beta Was this translation helpful? Give feedback.
-
for getting access token I am using "http://localhost:8088/api/v1/security/login" and getting proper access token and refresh token
Below is my superset_config.py file
Beta Was this translation helpful? Give feedback.
All reactions