Twisted] 9. Autenthication
Twisted Cred Terms.
1) Credentials
The information to identify and verify user (usually username/password)
>> twisted.cred.credentials.ICredentials
2) Avatar
is server application business logic object. It's behaviour and data that user can do. ex) Mail server: mailbox / Web server: web resource / SSH server: remote shell
>> zope.interface.Interface
3) Credentials checker
Object to verify Credential through File, database or memory
>> twisted.cred.checker.ICredentialsChecker
>> twisted.cred.checkers.ANONYMOUS
4) Realm
Object which provides the way to any possible avatar within application.
5) Portal
is like window between User and Cred.
Example
1) using variable/file
https://github.com/AstinCHOI/book_twisted/blob/master/ch9_authentication/echo_cred.py
2) using DB
https://github.com/AstinCHOI/book_twisted/blob/master/ch9_authentication/echo_server.py
https://github.com/AstinCHOI/book_twisted/blob/master/ch9_authentication/echo_server.py
3) twistd application authentication
ref. Chapter 6.
https://github.com/AstinCHOI/book_twisted/tree/master/ch9_authentication/echoproject
and just changed Plug-in.
https://github.com/AstinCHOI/book_twisted/tree/master/ch9_authentication/echoproject/twisted/plugins
(in this case, check with /etc/passwd and /etc/shadow)
Link: Twisted's Web in 60 seconds
https://twistedmatrix.com/documents/current/web/howto/web-in-60/