Need help on token-based authentication

66 views
Skip to first unread message

Calvin Chen

unread,
Feb 6, 2014, 4:05:59 AM2/6/14
to django...@googlegroups.com
Hi,

I couldn't find any real example about how to use token-based authentication in Django, and how to let it work with front-end MVC framework like AngularJS.
Do you guys have any ideas?

Kind Regards,
Calvin

Rahul Gaur

unread,
Feb 6, 2014, 5:03:03 AM2/6/14
to django...@googlegroups.com
Hi ,
You can take a look at the following GIST : https://gist.github.com/aregee/6310787
I have two projects , that implement the Token based authentication.
I have used Django Tastypie for rolling out the RESTful apis and since tastypie offers ApiKeyAuthentication() method , on the client side I have used AngularJS. My gist link contains factory session service for angularJs that stores the user details ie: Api Key and username in the browser cache.
For every request the angular code makes to server , it appends the api key to headers.

Code quality is not really very great , but I think you can get a brief idea.
Let me know if you have any questions.

Project Repos :
https://github.com/aregee/moksaya
https://github.com/aregee/musicstore

Regards,
Rahul


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/bf839d9c-c92e-4206-a5c7-a01ce1ee556d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
-------------------------------------------------------------------------------------------------------
Rahul Gaur
irc : iamaregee2
Web: http://www.rahulgaur.info
Github: https://github.com/aregee

Calvin Chen

unread,
Feb 6, 2014, 5:19:49 AM2/6/14
to django...@googlegroups.com
Hi Rahul Gaur,

Thanks for your answer.
I will definitely take a look at the gist and repositories that you provided.
Hopefully, it will gives me some ideas. :-)

Thanks a lot.

Kind Regards,
Cheng
Reply all
Reply to author
Forward
0 new messages