M
M
melikbekyan2016-10-25 19:43:23
Django
melikbekyan, 2016-10-25 19:43:23

How to override authentication in django-rest-framework?

How to override authentication that is implicitly called in django-rest-framework?
8b4b249d38fb41c6943e4bb54a9cce4f.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Tehtehteh, 2016-10-25
@Tehtehteh

The essence of the question is not entirely clear, but I'll try. To override authentication in DRF, you need to create a new class for your authentication that will inherit from BaseAuthentication. Next, you should override the authenticate method in it, which will return a tuple from (user, auth) or None in case of a fail.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question