{"id":7600,"date":"2015-09-07T08:27:53","date_gmt":"2015-09-07T08:27:53","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/09\/07\/plug-in-django-allauth-as-endpoint-in-django-rest-framework-open-source-projects-tomchristie-django-rest-framework\/"},"modified":"2015-09-07T08:27:53","modified_gmt":"2015-09-07T08:27:53","slug":"plug-in-django-allauth-as-endpoint-in-django-rest-framework-open-source-projects-tomchristie-django-rest-framework","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/09\/07\/plug-in-django-allauth-as-endpoint-in-django-rest-framework-open-source-projects-tomchristie-django-rest-framework\/","title":{"rendered":"Plug in django-allauth as endpoint in django-rest-framework-open source projects tomchristie\/django-rest-framework"},"content":{"rendered":"<p><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b0ff4af6241fe73606672d9d0080c792?s=128&amp;d=identicon&amp;r=PG\" \/> <strong>kaay<\/strong><\/p>\n<p>While I&#8217;m not quite sure how to use allauth and rest-fremework together, allauth does not offer such an endpoint. Suggestion: make your own that does a variation of the following: Call allauth.socialaccount.providers.facebook.views.fb_complete_login(None, socialtoken) where socialtoken is as created in login_by_token. That performs (a few functions deeper) a django.contrib.auth.login, possibly creating the acct. After that, for use on mobile devices, it might be possible to the the auth (not FB) token: get the user data (from session?), and call rest_framework.authtoken.views.obtain_auth_token Notes: 1. This offers no way to resolve email conflicts or connect social\/local accts.<\/p>\n<p>2. I haven&#8217;t tried it &#8211; please post code if you can get it working.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>kaay While I&#8217;m not quite sure how to use allauth and rest-fremework together, allauth does not offer such an endpoint. Suggestion: make your own that does a variation of the following: Call allauth.socialaccount.providers.facebook.views.fb_complete_login(None, socialtoken) where socialtoken is as created in login_by_token. That performs (a few functions deeper) a django.contrib.auth.login, possibly creating the acct. After that, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7600","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7600","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7600"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7600\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}