Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » Linux password authentication for django [RSS Feed]

#1 Dec. 30, 2010 05:35:18

B.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Linux password authentication for django


Hi there,

I want to know is there any authentication module base on Linux passwd/
shadow file for django?

Many thanks,
Bill

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Dec. 30, 2010 12:51:45

Michael P.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Linux password authentication for django


On 29/12/10 Bill said:

> Hi there,
>
> I want to know is there any authentication module base on Linux passwd/
> shadow file for django?

You want pam authentication. Look for django and pam.

Mikesignature.ascDescription:Digital signature

Attachments:
attachment signature.asc (197 bytes)

Offline

#3 Dec. 30, 2010 15:24:48

Marc A.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Linux password authentication for django


On Thu, Dec 30, 2010 at 6:35 AM, Bill <billchen...@gmail.com> wrote:

> Hi there,
>
> I want to know is there any authentication module base on Linux passwd/
> shadow file for django?
>http://atlee.ca/software/pam/module-index.htmlimport pam
from django.contrib.auth.models import User

class PamBackend:

def authenticate(self, username=None, password=None):
# Check the username/password and return a User.
if pam.authenticate(username, password, service='login'):
try:
return User.objects.get(username=username)
except User.DoesNotExist:
pass
return None


--
Marc

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#4 Dec. 30, 2010 15:42:09

Marc A.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Linux password authentication for django


On Thu, Dec 30, 2010 at 4:24 PM, Marc Aymerich <glicer...@gmail.com> wrote:

>
>
> On Thu, Dec 30, 2010 at 6:35 AM, Bill <billchen...@gmail.com> wrote:
>
>> Hi there,
>>
>> I want to know is there any authentication module base on Linux passwd/
>> shadow file for django?
>>
>
>http://atlee.ca/software/pam/module-index.html>
> import pam
> from django.contrib.auth.models import User
>
> class PamBackend:
>
> def authenticate(self, username=None, password=None):
> # Check the username/password and return a User.
> if pam.authenticate(username, password, service='login'):
> try:
> return User.objects.get(username=username)
> except User.DoesNotExist:
> pass
> return None
>
>
>
ouch, I misunderstood your question. if you're using mysql as a db backend
for you django project, you can use pam-mysqlhttp://pam-mysql.sourceforge.net/for the authentication on your servers.



--
Marc

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#5 Dec. 30, 2010 15:45:54

Marc A.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Linux password authentication for django


On Thu, Dec 30, 2010 at 4:41 PM, Marc Aymerich <glicer...@gmail.com> wrote:

>
>
> On Thu, Dec 30, 2010 at 4:24 PM, Marc Aymerich <glicer...@gmail.com>wrote:
>
>>
>>
>> On Thu, Dec 30, 2010 at 6:35 AM, Bill <billchen...@gmail.com> wrote:
>>
>>> Hi there,
>>>
>>> I want to know is there any authentication module base on Linux passwd/
>>> shadow file for django?
>>>
>>
>>http://atlee.ca/software/pam/module-index.html>>
>> import pam
>> from django.contrib.auth.models import User
>>
>> class PamBackend:
>>
>> def authenticate(self, username=None, password=None):
>> # Check the username/password and return a User.
>> if pam.authenticate(username, password, service='login'):
>> try:
>> return User.objects.get(username=username)
>> except User.DoesNotExist:
>> pass
>> return None
>>
>>
>>
> ouch, I misunderstood your question. if you're using mysql as a db backend
> for you django project, you can use pam-mysql
>http://pam-mysql.sourceforge.net/for the authentication on your servers.
>

also you can look for libpam-mysql* package on your distro. repositories . *


--
Marc

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#6 Dec. 31, 2010 17:57:26

B.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Linux password authentication for django


Hi Marc,

Thank you so much! You really helped me!

Bill

On Dec 30, 10:24 am, Marc Aymerich <glicer...@gmail.com> wrote:
> On Thu, Dec 30, 2010 at 6:35 AM, Bill <billchen...@gmail.com> wrote:
> > Hi there,
>
> > I want to know is there any authentication module base on Linux passwd/
> > shadow file for django?
>
>http://atlee.ca/software/pam/module-index.html>
> import pam
> from django.contrib.auth.models import User
>
> class PamBackend:
>
>     def authenticate(self, username=None, password=None):
>         # Check the username/password and return a User.
>         if pam.authenticate(username, password, service='login'):
>              try:
>                 return User.objects.get(username=username)
>             except User.DoesNotExist:
>                 pass
>         return None
>
> --
> Marc

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

  • Root
  • » Django
  • » Linux password authentication for django [RSS Feed]

Board footer

Moderator control

Enjoy the 15th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support