📄 authenticators.txt
字号:
$Id: authenticators.txt 140 2008-10-31 21:49:50Z unsaved $WebMail Authentication System==============================The WebMail authentication system uses plugin authenticators. Any newauthenticator can be placed in the webmail/lib/authenticators, and it willthen appear as an authentication option in the Administrator's main setupscreen.WebMail supports (since version 0.7.3) normal login and passwordauthenticaton as well as challenge/response authentication. Presently thetypes of authentication used are:Normal Authenticators:Simple -- Authenticate using a hashed password stored in the user's config fileUnix -- Authenticate using the Unix password "database" (/etc/passwd)IMAP -- Authenticate using an IMAP serverPOP -- Authenticate using a POP serverChallenge/Response Authenticators:OTP -- Authenticate using an RFC1938 (S/Key like) One Time Pass.The only other added twist in authentication is the use oforg.webengruven.webmail.auth.AuthDisplayMngr, this class providesinformation about which templates should be used, and any special variablesthat may need to be set.Creating an normal authentication plugin========================================Each authenticator must be dervied from net.wastl.webmail.server.Authenticator.The functions which MUST be defined are:void init(Storage) -- This basically acts as the constructor.void register(ConfigScheme) -- This will register the authenticator with the system.There are two functions that can be used for authentication. The onlydifference what data is available when they get called. So only one ofthem needs to be over-ridden.authenticatePreUserData(String login, String passwd, String domain)authenticatePostUserData(UserData ud, String passwd, String domain)Additionally there are three other functions which may be of interest:boolean canChangePassword()void changePassword(UserData ud, String passwd, String verify)AuthDisplayMngr getAuthDisplayMngr()Note that canChangePassword() defaults to true, but changePassword() isempty.Also note that getAuthDisplayMngr() returns a resonable default, which willdisplay the standard screens used for the normal authenticators.Creating a challenge/response authenticator===========================================Each challenge/resoponse authenticator must be derived fromorg.webengruven.webmail.auth.CRAuthenticator. Beyond that they are almostthe same as normal authenticators. There is one additional function whichMUST be defined:String getChallenge(UserData ud) -- Get a challenge for the user specified in ud, and return it as a string.getChallenge() is used to display a challenge, which the user can thenrespond to.The only other thing worth noting is that the getAuthDisplayMngr() returnsan instance of org.webengruven.webmail.auth.CRAuthDisplayMngr, whichchanges the layout of the login screen so that there is no password prompt,and sends the user to "/challenge" before authenticating them. Anychallenge/response authenticator that needs a custom AuthDisplayMngr shouldprobably derive it from CRAuthDisplayMngr.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -