android - Django all auth with access token, what settings to test? (for app) -


My usecase: User login from your Android app & amp; Get access token, then pass it on the dango. More specifically for the code below. I've included the administrator using Django my app customer ID and a token (ie localhost / admin)

My code

  def Facebook_login (request): ACCESS_TOKEN = request.POST [ 'allauth.socialaccount.models from allauth.socialaccount imports providers ACCESS_TOKEN'] print (ACCESS_TOKEN) SocialLogin from allauth.socialaccount.providers.facebook.views import fb_complete_login, SocialToken, SocialApp import complete_social_login from allauth.socialaccount.helpers Try import: App = SocialApp .objects.get (Provider = "Facebook") Print (Application) Token = SocialToken (Apps) Ation = application, token = ACCESS_TOKEN) print (token) login = fb_complete_login (application, token) login.token = token print (login) login. # FIXME :: State = SocialLogin.state_from_request (request) retired = complete_social_login (Request, Access) Print (retired) #if we got here we return HttpResponse ( "success") only what return HttpResponse ( "Catch succeeded except Need is unsuccessful ")   

How can I test if this works on my local machine? ? I need what settings

do

  c = Client (R) = c.post ( '/ login /', { 'ACCESS_TOKEN': 'adadasfvaera10238123094572zwcd'} )  

Any access token from Facebook always fails. Where do I put in my application ID to enable it?


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

lua - HowTo create a fuel bar -