User authentication in another server

Hi basically I have this problem where I have two servers where first one is for rendering webpage with django and the other server is solely for user authentication (So the user DB is on this server).

That means every time user access the webpage through server 1, then redirect to the login page in auth server, and if auth success, it carries a token and redirect back to server 1. Everytime it goes to another page it will check if the token still valid etc… (Like OAuth but I want to create the user auth server myself)

I have already written a user token authentication API backend using Rest framework and the question is is there any way I could use Django default user auth method and declorator or even using default in django.contrib.auth? How would the API call be implemented.

I don’t find any tutorials in this regard, usually you have your django webpage server bundled with user DB so you do all the things locally. Do I need to write the whole methods? Is there any existing template/tutorial that do what I want and so I could learn from it?

Thanks in advance.

This appears to be a duplicate of Login authentication using DRF API backend. There’s no need to post the same issue or question multiple times.

See your other copy of this topic for further discussion.

Hi Ken yes the spam filter blocked this post so I posted another one, feel free to delete this post thanks!


Our automated spam filter, Akismet , has temporarily hidden your post in User authentication in another server for review.

A staff member will review your post soon, and it should appear shortly.

We apologize for the inconvenience.

I don’t have the authority to do that. If it’s possible to be done, the three-dot icon on your original post can be clicked to expand your options. There may be a trash icon that you can use to delete this.