kenho811 commented on issue #19525:
URL: https://github.com/apache/superset/issues/19525#issuecomment-3692108236
> Actually I was able to solve this problem.
>
> ```
> import requests
> # from bs4 import BeautifulSoup
>
> username = "admin"
> password = "admin"
> session = requests.session()
>
> login_form = session.post('http://localhost:8088/login')
> # soup = BeautifulSoup(login_form.text, 'html.parser')
> # csrf_token = soup.find('input',{'id':'csrf_token'})['value']
> data = {
> 'username': username,
> 'password': password,
> # 'csrf_token': csrf_token
> }
> response = session.post('http://localhost:8088/login', data=data)
> response = session.get('http://localhost:8088/api/v1/me')
> ```
>
> This is a work around to make this api work. Comment out the lines in
above code, if you want CSRF token i.e iff you enabled the flag in config
Using `requests.session` worked for me in superset 6.0. Thank you so much!
--
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]