I'm having a problem with authentication from libcurl in C. This works fine from my android/iPhone apps, and from the browser, but libcurl can't authenticate. here's how i'm doing it in django: authentication function: user = authenticate(username=username, password=password) request.session['member_id'] = user.id typical user function: id = request.session['member_id'] if id is not None: Do something useful else: Return Error Message
in libcurl: auth function CURL *session = curl_easy_init(); if (session) { curl_easy_setopt(session, CURLOPT_URL, url); curl_easy_perform(session); } g_free(url); curl_easy_cleanup(session); generic function: *session = curl_easy_init(); if (session) { char* url = g_strconcat(URL,"/getremotedevice/",NULL); printf("url:%s\n",url); curl_easy_setopt(session, CURLOPT_URL, url); curl_easy_setopt(session, CURLOPT_WRITEFUNCTION, get_active_decives_callback); curl_easy_perform(session); g_free(url); } curl_easy_cleanup(session); Am i doing something wrong? Thanks Kevin On Sun, Jan 8, 2012 at 12:22 PM, Kevin Anthony <kevin.s.anth...@gmail.com>wrote: > > https://docs.djangoproject.com/en/1.3/topics/auth/#authentication-in-web-requests > > On Sun, Jan 8, 2012 at 12:20 PM, Stodge <sto...@gmail.com> wrote: > >> This link is giving me a Page Not Found. >> >> On Jan 7, 1:10 pm, Michael Elkins <m...@sigpipe.org> wrote: >> > On Sat, Jan 07, 2012 at 11:52:26AM -0500, Kevin Anthony wrote: >> > >I have a small exposed json API, currently it doesn't require >> > >authentication, but i'd like to integrate it with django's >> authentication. >> > > A quick google search came up empty, and i was wondering if anyone had >> > >any recommendations on how to do this? >> > >> > I've done this before using forms and POST, but you could easily >> > put the user credentials in your json object and use >> > django.contrib.auth as described here: >> > >> > https://docs.djangoproject.com/en/1.3/topics/Aauth/#authentication-in. >> .. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To post to this group, send email to django-users@googlegroups.com. >> To unsubscribe from this group, send email to >> django-users+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/django-users?hl=en. >> >> > > > -- > Thanks > Kevin Anthony > www.NoSideRacing.com > > Do you use Banshee? > Download the Community Extensions: > http://banshee.fm/download/extensions/ > > -- Thanks Kevin Anthony www.NoSideRacing.com Do you use Banshee? Download the Community Extensions: http://banshee.fm/download/extensions/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.