django rest framework - token authentication logout

前端 未结 3 1610
感情败类
感情败类 2020-12-30 20:32

I have implemented the Token Authentication according to the django rest framework Docs.

Form what I read, the Token Authentication of DRF is quite simple - one to

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-30 21:18

    It sounds like SessionAuthentication is what you are really looking. You can start(login) a session via BasicAuthentication or TokenAuthentication. Then use sessionid as your "token" for the rest of api calls. The "token" expires when you logout or exceed certain timing.

    If you run into csrftoken issue using session authentication, this could be a very helpful.

提交回复
热议问题