leschiffres commented on issue #31675: URL: https://github.com/apache/superset/issues/31675#issuecomment-2610076455
@rusackas I also encountered this issue when I installed the latest superset version. The following code was working normally and when I updated the superset version I was getting the error that @RenePab was getting. ```python import requests base_url = "http://localhost:8088/" # Start a session to maintain cookies across requests session = requests.Session() payload = { "username": "admin", "password": "admin", "provider": "db" } # Login and get the access token r = session.post(base_url + 'api/v1/security/login', json=payload) access_token = r.json()['access_token'] print(access_token) # Add the access token to the session headers session.headers.update({ "Authorization": "Bearer " + access_token }) # Request the CSRF token r = session.get(base_url + 'api/v1/security/csrf_token/') csrf_token = r.json()['result'] print(csrf_token) # Update headers with the CSRF token session.headers.update({ 'Content-Type': 'application/json', 'X-CSRF-TOKEN': csrf_token }) # Prepare payload for guest token request payload = { "resources": [ { "type": "dashboard", "id": "23680d7e-ba50-4a4e-94f0-3974994656ea", } ], "rls": [], "user": { "username": "report-viewer", "first_name": "report-viewer", "last_name": "report-viewer", } } # Request the guest token r = session.post(base_url + 'api/v1/security/guest_token/', json=payload) # Print the response print(r.json()['token']) ``` -- 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]
