When you use the Django REST environment with iOS, if you are not using a browser, the standard Django authentication system is out of the question. This is detected through the DRF authentication system as SessionAuthentication and relies on your application to send cookies and a CSRF token with a request, which is usually not possible.
In most cases where you already use the Django authentication system, and you can trust your application password store, you would use something like BasicAuthentiction . Most people cannot, although they do not trust their application ecosystem, and therefore use a token-based authentication system like TokenAuthentication or OAuth2Authorization (in combination with the OAuth provider ). You can learn more about each type of authentication in this stack overflow answer .
But in your situation, you are mostly limited to using something like OAuth 2 . This is because you need to associate a user with a token, and most authentication systems require you to provide a username and password. For social accounts, this is usually not the case, and usually they cannot log in. OAuth 2 works in conjunction with the standard Django login, so you are not limited to just a username and password. I wrote more about how this works in this detailed stack overflow answer .
Kevin brown
source share