python - django tastypie - api authentication ? its server for ios app -


i building ios app talks django server getting data.

this app uses facebook authentication login, thinking this:

in ios app, after clicking login button(fb auth), userdata(like username, email etc facebook) , access_token. store username , accesstoken in ios app somewhere(like session) , every call server getting data, send these 2 also(username , accesstoken).

in server, tasty pie has authentication can customised this:

class sillyauthentication(authentication): def is_authenticated(self, request, **kwargs):     user = user.objects.get(username=username)  -- username sent ios app.      #checking token sent token saved during registration.     #i hope, fb sends same authtoken everytime logins.     if user.userprofile.access_token == access_token:        return true      return false 

so, means, everytime request sent ios app, need send username, accesstoken. got mind, not sure if right or wrong .


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -