[Twisted-Python] how to implement login form logic with twisted.cred checkers, credentials and portal

Glyph glyph at twistedmatrix.com
Wed Mar 23 19:16:37 MDT 2016


> On Mar 2, 2016, at 6:32 AM, snailcoder <snailcoder at 163.com> wrote:
> 
> I'm trying to implement some login logic using twisted.cred module for a website. In short, there's a login page with username/password forms. Once the user input the right username/password, the browser will redirect to another page which includes the user's profile. 
> 
> Does anyone have any ideas about how to implement this logic with twisted.cred checkers, credentials and portal? Any suggestion is appreciated :-) 

Sorry for the long delay.  I kept wanting to give this a more elaborate response.

There's an example of doing this - sort of - in Nevow, here: https://github.com/twisted/nevow/blob/master/nevow/guard.py <https://github.com/twisted/nevow/blob/master/nevow/guard.py>.  It's not perfectly equivalent because it uses Nevow's slightly-incompatible IResource interface, and not Twisted's IResource.

Have you tried anything and gotten stuck or were you just curious about how it might be done?

I've filed a ticket here: https://twistedmatrix.com/trac/ticket/8248 <https://twistedmatrix.com/trac/ticket/8248> since this functionality should be in Twisted.

-glyph

-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20160323/29fd4f8d/attachment-0002.html>


More information about the Twisted-Python mailing list