# Login de admin do Discourse retorna erro 403 \["BAD CSRF"\]

**URL:** <https://meta.discourse.org/t/discourse-admin-login-throws-403-bad-csrf-error/86028>\
**Category:** Product Support\
**Created:** [24 Abril , 2018 03:19 UTC](https://meta.discourse.org/t/discourse-admin-login-throws-403-bad-csrf-error/86028 "2018-04-24T03:19:22Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![lzhang](https://avatars.discourse-cdn.com/v4/letter/l/90ced4/32.png) [@lzhang](https://meta.discourse.org/u/lzhang)\
**Post date:** [24 Abril , 2018 03:46 UTC](https://meta.discourse.org/t/discourse-admin-login-throws-403-bad-csrf-error/86028/3 "2018-04-24T03:46:50Z")

</div>

Thanks Matt,

To eliminate the network and traffic influence, what I did earlier today was:

1. Get into the docker container with command **docker exec -it app /bin/bash**
2. Do curl call to localhost:3000 to get a csrf token:  
**curl -X GET [http://localhost:3000/session/csrf](http://localhost:3000/session/csrf) -H ‘X-Requested-With: XMLHttpRequest’**.
3. Then call a login request with the token got:  
curl -X POST [http://localhost:3000/session](http://localhost:3000/session) -H ‘Content-Type: application/x-www-form-urlencoded’ -H ‘X-CSRF-Token: qh4CYDsFXIlZ70MJ7bz6FLHxrKRR0zVQoKLOPDyKeXJbkzV/+NEk3JTCaEDFcZ/vzAZa3MhKuETcquJ9zarTKw==’ -H ‘X-Requested-With: XMLHttpRequest’ -d ‘login=test&password=testpassword’

Still got 403 bad csrf error with that.

---

_[View the full topic](https://meta.discourse.org/t/discourse-admin-login-throws-403-bad-csrf-error/86028)._
