The Django REST framework provides the following three authentication classes in the rest_framework.authentication module. All of them are subclasses of the BaseAuthentication class:
- BasicAuthentication: This class provides an HTTP basic authentication against a username and a password.
- SessionAuthentication: This class works with Django's session framework for authentication.
- TokenAuthentication: This class provides a simple token-based authentication. The request must include the token generated for a user as the value for the Authorization HTTP header key with the 'Token ' string as a prefix for the token.
Of course, in a production environment, we must make sure that the RESTful Web Service ...