Django REST Authenticate with Session in external app

103 views
Skip to first unread message

flaudizio

unread,
Sep 11, 2016, 5:19:15 PM9/11/16
to Django users
Hi guys,

I'm a doubt about Django REST auth and an external app's (mobile, desktop).

When we work with django in browser we have a session auth. To use session it's possible using django rest with an external app created in C sharp ? Or need to work with tokens in external app consulting my Django API REST ?

Thank's a lot.

James Schneider

unread,
Sep 11, 2016, 6:13:45 PM9/11/16
to django...@googlegroups.com

You can do either. As long as your app is intelligent enough to perform a standard REST authentication and receive the session token. Most, if not all, languages have libraries built-in to handle this easily.

Token authentication can be used, but you generally see that deployed as a service account for static resources (ie other servers) to communicate, and are not meant to change very often. If you are planning on having the credentials for your API cached in the local app long term, then a token may be advisable.

DRF supports both.

-James

flaudizio

unread,
Sep 11, 2016, 7:21:01 PM9/11/16
to Django users
Thank's James.

Very clearly now.

Chris Bartos

unread,
Dec 27, 2016, 4:50:39 PM12/27/16
to Django users
Hello there!

Although you COULD use Session Authentication to authenticate users from external clients. I don't recommend it. It's going to be a pain. Instead what I recommend is using either Token Authentication or OAuth2 Authentication. They both allow you to authenticate from any client through the API rather than trying to authenticate through the Django view.

I'd be interested in hearing how Session Authentication is working for you and if you need help don't hesitate to ask questions about Token Authentication or OAuth2 Authentication.

Chris
Reply all
Reply to author
Forward
0 new messages