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
Post a Comment