I'd raise a custom exception (e.g. "PasswordExpiredError") and handle
the message creation in the view.

On Jul 26, 3:59 pm, Steven Smith <[email protected]> wrote:
> Is there a way to access the HttpResponse, or issue a redirect from
> within a custom authentication backend? I have Django hooked up to our
> Active Directory server, and it works perfectly except when the user's
> password expires or they have "User must change password at next
> login" set on their account. In these circumstances, I'd like to be
> able to spit out a message (using contrib.messages) stating that they
> are required to change their password, and then (ideally) issue an
> HttpResponseRedirect over to our "change password" website, which is,
> coincidentally, on the same Django system, so the message would carry
> over and stuff... but I need to be able to set it in the first place.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to