pedrohdemedeiros opened a new issue, #19525:
URL: https://github.com/apache/superset/issues/19525

   I cannot use the API succefully for any request (except to get the secutiry 
tokens), always getting " Response 401" for any request. 
   
   #### How to reproduce the bug
   On the docker container where the superset is running:
   
   ```
   >>>
   import requests
   
   session = requests.session()
   
   jwt_token = session.post(
       url='http://localhost:8088/api/v1/security/login',
       json={
       "username": "admin",
       "password": "admin",
       "refresh": False,
       "provider": "db"
       }
   ).json()["access_token"]
   
   csrf_token = session.get(
       url='http://localhost:8088/api/v1/security/csrf_token/',
       headers={
           'Authorization': f'Bearer {jwt_token}',
       }
   ).json()["result"]
   
   headers = {
       'accept': 'application/json',
       'Authorization': f'Bearer {jwt_token}',
       'X-CSRFToken': csrf_token,
   }
   
   #trying to use the "current user" request as a test
   response = requests.get('http://localhost:8088/api/v1/me', headers=headers)
   
   session.close()`
   ```
   > >>
   response
   
   
   ### Expected results
   
   {
     "result": {
       "email": "[email protected]",
       "first_name": "Superset",
       "id": 1,
       "is_active": true,
       "is_anonymous": false,
       "last_name": "Admin",
       "username": "admin"
     }
   }
   
   ### Actual results
   ```
   >>> response
   <Response [401]>
   ```
   
   #### Screenshots
   
   ### Environment
   
   (please complete the following information):
   
   
   - superset version: v1.0.0
   - python version: Python 3.8.12
   
   ### Checklist
   
   - [ x] I have checked the superset logs for python stacktraces and included 
it here as text if there are any.
   - [x ] I have reproduced the issue with at least the latest released version 
of superset.
   - [ x] I have checked the issue tracker for the same issue and I haven't 
found one similar.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to