Please crossing look at the certification flowchart I've drawn.
The twisted certification mechanism consists of several key components
1.credentials
Implements the Twisted.cred.credentials.ICredentials interface, which is the authenticated user information, usually the user name and password. It can also be data or objects (such as certificates or challenge/response protocols) that other data uses to prove a user's identity.
2.avatar
is a business logic object that represents operations and user data that can be performed by a user in a service application. For example, for a mail server, avatar is similar to a mailbox object. For a Web server, avatar is a resource resource object. For the SSH protocol, it could be a remote shell.
3.avatar ID
is a string, returned by credentials Checker, that identifies the avatar resource to the user. is typically a user name, but may also be another unique identifier. For example Avatarid is "Joe Smith", "[email protected]" and "usertest1234"
4.credentials Checker
is a certification detection object, credentials Checker is a certification bridge, checker can be stored in many forms, such as databases, files, memory and other authentication methods. If the authentication succeeds, it returns a Avatarid to realm, and a Avatar object is returned by realm. Checkers also supports anonymous access and returns Twisted.cred.checkers.ANONYMOUS. The credentials implements the Twisted.cred.checker.ICredentialsChecker interface.
5.Realm
Provides resource access to the legal avatar ID and returns the Avatar object. The Twisted.cred.portal.IRealm interface is implemented to support different resources and services that are not used to access the same. For example, "[email protected]" Access to the Mail service system, test users are visiting the forum and so on.
6.Portal
Is the middle tier between the authentication mechanism and the Protocol, and all operations that require authentication are authenticated and processed by the port, and the successful realm returns the resources that the user needs to access.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Authentication mechanism of TWISTED13 twisted