savage-lands/share/readmes/drf_token_auth.md

24 lines
851 B
Markdown
Raw Permalink Normal View History

2025-04-17 00:41:48 +03:00
## Notes
facebook authorization requests are different than straight user/pass requests. One requires the user and pass registered with the django app when they signed in, etc. The other is via the users facebook account.
So the user must paas in his facebook account name and password
### try using standard api get token method
Unlike the facebook request,this one passes the username and password that is already stored in Django
http http://127.0.0.1:8026/api-token-auth/ username=someuser1 password=testpass1
got to [facebook dev apps](https://developers.facebook.com/apps/)
get the
facebook test user name/pass
get client id and client secret from settings
apply:
`curl -X POST -d "client_id=<client_id>&client_secret=<client_secret>&grant_type=password&username=<user_name>&password=<password>" http://localhost:8000/auth/token