简体   繁体   中英

How to authenticate from one server to another server in python/django?

Can anybody help me about how to login from one server to an another.. ?? (One application running on 127.0.0.1:8000 and another on 127.0.0.1:8001)

I have two django application. In one of them I have implemented authentication using rest framework. Now I want to implement authentication in another application using first application database (User table).

You need to implement token-based access control, ie:

  1. List item The user authenticates against the first django app
  2. List item Upon successful authentication the server returns a token to the client
  3. List item The client then sends the token to the second application with each request (in the request header)

You may want to use Django OAuth Toolkit for that end.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM