Hi,

Am trying to write a customized authentication model.
In authenticate function I do the following.

    def authenticate(self, username=None, password=None):
        try:
            # Check if this user is valid on the mail server
            s.auth = HttpNtlmAuth(username, password, s)
        except:
            return None

        try:
            # Check if the user exists in Django's local database
            user = User.objects.get(email=username)
        except User.DoesNotExist:
            # Create a user in Django's local database
            user = User.objects.create_user(time.time(), username, 
'passworddoesntmatter')

        return user


When does this user object get deleted eventually ?

Once the user is authenticated am going to associate it with session.
Will this authenticate function get called again and again if multiple 
requests are made in the same session ?

I want to take the logoff functionality out of the client so i will be 
setting expiry in the session.
When the session expires i.e expiry time is 0 or less, i will again 
authenticate the user and reset expiry time.
That way session remains intact. Is there a better approach to this ?

When clearsession is called session object will get deleted from DB, will 
it also trigger deletion of User object ? 

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/af631185-ab5e-4dda-bacb-89fdcb2dd88e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to