0

I was planning on using django-oneall for social-network authentication for my app, but I don't see it listed in the third-party authentication packages suggested for django-rest-framework. Has anyone used this? If so, is there much extra work involved meaning I might be better off using django-rest-auth along with django-allauth instead?

Any suggestions would be appreciated.

ckot
  • 819
  • 2
  • 10
  • 23

1 Answers1

0

Because django_oneall uses session authentication it turns out to be pretty simple to setup.

I did need quite a bit of help figuring it out though.

All you need to do is:

settings.py

REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': (
        'rest_framework.authentication.SessionAuthentication',
    ),
}

django_oneall handles the session authentication, so that's it.

The only problem I had, which wasn't unique to using django-oneall at all was that I didn't realize it expected both the csrftoken cookie AND a X-CSRFToken HTTP Header as well. Unlike most projects where documentation is lacking, the rest framework has lots of excellent documentation - i guess I simply caught with a TL;DR this time. good to know that the rest framework is easy to integrate with if you're using session authentication.

Community
  • 1
  • 1
ckot
  • 819
  • 2
  • 10
  • 23