ClearBox Server v1.2 Developer's Guide |
ICommonAuthentication::GetUserPasswordCalled by server to request user's password to authenticate him.
HRESULT GetUserPassword( [in] long tag, [in,out] USERINFO * userInf, [out] VARIANT_BOOL * clearTextPassword, [out] VARIANT_BOOL * caseSensitive, [out] VARIANT_BOOL * ignorePassword, [out] VARIANT_BOOL * userExist); Parameters
Return ValuesIf extension returns error code, it is assumed that user was not found as if userExist was set to VARIANT_FALSE. Thread SafetyThis method is called in context of WORK thread. (See Server Threads Model for details.) You should synchronize data which is shared with other threads. Memory ManagementServer allocates and frees memory for userInf fields (except for userPassword, which is allocated by extension), so extension must not change them. RemarksIf extension reports that password is unavailable in clear text and server has unencrypted password provided by user, ICommonAuthentication::CheckPassword is called. If userExist=VARIANT_FALSE, server will reject user (doesn't matter what the values of other parameters are). If userExist=VARIANT_TRUE and ignorePassword=VARIANT_TRUE, password check is skipped, no matter what clearTextPassword is equal to, but ITACACSAuthentication::CanAuthenticate or IRADIUSAuthentication::CanAuthenticate is called anyway. Example CodeThis code assumes that we know password for the only user John, and server should check it. STMETHODIMP CTest::GetUserPassword ( long tag, USERINFO * userInf, VARIANT_BOOL * clearTextPassword, VARIANT_BOOL * caseSensitive, VARIANT_BOOL * ignorePassword, VARIANT_BOOL * userExist) { // We assume thay there's only one user "John" if (wcscmp(userInf->userName,L"John")!=0) { *userExist=VARIANT_FALSE; return S_OK; } userInf->userPassword=SysAllocString(L"mysuperpassword"); //We know John's password *clearTextPassword=VARIANT_TRUE; //We allow John to enter passwords like "MySuPerpassWORD" *caseSensitive=VARIANT_FALSE; //Check John's password *ignorePassword=VARIANT_FALSE; *userExist=VARIANT_TRUE; return S_OK; } See AlsoICommonAuthentication, ICommonAuthentication::CheckPassword, IRADIUSAuthentication::CanAuthenticate, ITACACSAuthentication::CanAuthenticate, Common authentication process © 2001-2003 XPerience Technologies. www.xperiencetech.com |
Created by chm2web html help conversion utility. |