TAuthenticator

From Ultibo.org
Jump to: navigation, search

Return to Unit Authentication


Description


To be documented

Class definitions



TAuthenticator = class(TObject)

Note: The base authenticator class, not intended to be used directly.
 
public
constructor Create;  
destructor Destroy; override;  
private
FLock:TCriticalSectionHandle;  
protected
FMode:LongWord;  
FFlags:LongWord;  
 
FPasswordPrompt:String; The text prompt for password only entry (Default: 'Password: ')
 
FOnCheckPassword:TCheckPasswordEvent;  
 
FUsernamePrompt:String; The text prompt for username entry (Default: 'Username: ')
FUserPasswordPrompt:String; The text prompt for user password entry (Default: 'Password: ')
 
FCaseSensitiveUsername:Boolean; True if usernames should be compared case sensitively (Default: False)
FCaseSensitivePassword:Boolean; True if passwords should be compared case sensitively (Default: True)
 
FOnCheckUsername:TCheckUsernameEvent;  
FOnCheckUserPassword:TCheckUserPasswordEvent;  
 
FTokenName:String; The parameter name to use for the token in URLs (Default: 'token')
FCookieName:String; The cookie name to use for the token (Default: 'sessionid')
FUseCookie:Boolean; True if cookies should be used for token exchange (eg HTTP cookies) or False otherwise, protocol dependent (Default: True)
 
FTokenTimeout:LongWord; Timeout value in seconds for token expiry (Default: INFINITE)
 
FReturnURLName:String; The parameter name to use for the return URL in request URLs (Default: 'returnurl')
 
FAuthenticateURL:String; The URL to redirect to for authentication (Default: <None>)
FDeauthenticateURL:String; The URL to redirect to after deauthentication (Default: <None>)
 
FOnCheckToken:FCheckTokenEvent;  
 
FOnCreateToken:TCreateTokenEvent;  
FOnDeleteToken:TDeleteTokenEvent;  
 
FOnCheckKey:TCheckKeyEvent;  
 
function AcquireLock:Boolean;  
function ReleaseLock:Boolean;  
 
procedure SetMode(AMode:LongWord); virtual;  
procedure SetFlags(AFlags:LongWord); virtual;  
 
function FixUsername(const AUsername:String):String; virtual;  
function FixPassword(const APassword:String):String; virtual;  
 
function GetPasswordPrompt:String; virtual;  
procedure SetPasswordPrompt(const APrompt:String); virtual;  
 
function GetUsernamePrompt:String; virtual;  
procedure SetUsernamePrompt(const APrompt:String); virtual;  
function GetUserPasswordPrompt(const AUsername:String):String; virtual;  
procedure SetUserPasswordPrompt(const AUsername,APrompt:String); virtual;  
 
function GetTokenName:String; virtual;  
procedure SetTokenName(const AName:String); virtual;  
function GetCookieName:String; virtual;  
procedure SetCookieName(const AName:String); virtual;  
 
function GetReturnURLName:String; virtual;  
procedure SetReturnURLName(const AName:String); virtual;  
 
function GetAuthenticateURL:String; virtual;  
procedure SetAuthenticateURL(const AURL:String); virtual;  
function GetDeauthenticateURL:String; virtual;  
procedure SetDeauthenticateURL(const AURL:String); virtual;  
public
property Mode:LongWord read FMode write SetMode;  
property Flags:LongWord read FFlags write SetFlags;  
 
property PasswordPrompt:String read GetPasswordPrompt write SetPasswordPrompt;  
 
property OnCheckPassword:TCheckPasswordEvent read FOnCheckPassword write FOnCheckPassword;  
 
property UsernamePrompt:String read GetUsernamePrompt write SetUsernamePrompt;  
property UserPasswordPrompt[const Username:String]:String read GetUserPasswordPrompt write SetUserPasswordPrompt;  
 
property CaseSensitiveUsername:Boolean read FCaseSensitiveUsername write FCaseSensitiveUsername;  
property CaseSensitivePassword:Boolean read FCaseSensitivePassword write FCaseSensitivePassword;  
 
property OnCheckUsername:TCheckUsernameEvent read FOnCheckUsername write FOnCheckUsername;  
property OnCheckUserPassword:TCheckUserPasswordEvent read FOnCheckUserPassword write FOnCheckUserPassword;  
 
property TokenName:String read GetTokenName write SetTokenName;  
property CookieName:String read GetCookieName write SetCookieName;  
property UseCookie:Boolean read FUseCookie write FUseCookie;  
 
property TokenTimeout:LongWord read FTokenTimeout write FTokenTimeout;  
 
property ReturnURLName:String read GetReturnURLName write SetReturnURLName;  
 
property AuthenticateURL:String read GetAuthenticateURL write SetAuthenticateURL;  
property DeauthenticateURL:String read GetDeauthenticateURL write SetDeauthenticateURL;  
 
property OnCheckToken:FCheckTokenEvent read FOnCheckToken write FOnCheckToken;  
 
property OnCreateToken:TCreateTokenEvent read FOnCreateToken write FOnCreateToken;  
property OnDeleteToken:TDeleteTokenEvent read FOnDeleteToken write FOnDeleteToken;  
 
property OnCheckKey:TCheckKeyEvent read FOnCheckKey write FOnCheckKey;  
 
function CheckPassword(const APassword:String):LongWord; virtual;  
 
function AddPassword(const APassword:String):LongWord; virtual;  
function DeletePassword(const APassword:String):LongWord; virtual;  
 
function CheckUsername(const AUsername:String):LongWord; virtual;  
function CheckUserPassword(const AUsername,APassword:String):LongWord; virtual;  
function AddUsername(const AUsername,APassword:String):LongWord; virtual;  
function DeleteUsername(const AUsername,APassword:String):LongWord; virtual;  
 
function CheckToken(const AToken,AValue:String):LongWord; virtual;  
 
function CreateToken(const AValue:String; var AToken:String; ATimeout:LongWord):LongWord; virtual;  
function DeleteToken(const AToken,AValue:String):LongWord; virtual;  
 
function CheckKey(AData:Pointer; ASize:LongWord):LongWord; virtual;  


Function declarations



constructor TAuthenticator.Create;
Description: To be documented
Note None documented


destructor TAuthenticator.Destroy;
Description: To be documented
Note None documented


function TAuthenticator.AcquireLock:Boolean;
Description: To be documented
Note None documented


function TAuthenticator.ReleaseLock:Boolean;
Description: To be documented
Note None documented


procedure TAuthenticator.SetMode(AMode:LongWord);
Description: To be documented
Note None documented


procedure TAuthenticator.SetFlags(AFlags:LongWord);
Description: To be documented
Note None documented


function TAuthenticator.FixUsername(const AUsername:String):String;
Description: To be documented
Note None documented


function TAuthenticator.FixPassword(const APassword:String):String;
Description: To be documented
Note None documented


function TAuthenticator.GetPasswordPrompt:String;
Description: To be documented
Note None documented


procedure TAuthenticator.SetPasswordPrompt(const APrompt:String);
Description: To be documented
Note None documented


function TAuthenticator.GetUsernamePrompt:String;
Description: To be documented
Note None documented


procedure TAuthenticator.SetUsernamePrompt(const APrompt:String);
Description: To be documented
Note None documented


function TAuthenticator.GetUserPasswordPrompt(const AUsername:String):String;
Description: To be documented
Note None documented


procedure TAuthenticator.SetUserPasswordPrompt(const AUsername,APrompt:String);
Description: To be documented
Note None documented


function TAuthenticator.GetTokenName:String;
Description: To be documented
Note None documented


procedure TAuthenticator.SetTokenName(const AName:String);
Description: To be documented
Note None documented


function TAuthenticator.GetCookieName:String;
Description: To be documented
Note None documented


procedure TAuthenticator.SetCookieName(const AName:String);
Description: To be documented
Note None documented


function TAuthenticator.GetReturnURLName:String;
Description: To be documented
Note None documented


procedure TAuthenticator.SetReturnURLName(const AName:String);
Description: To be documented
Note None documented


function TAuthenticator.GetAuthenticateURL:String;
Description: To be documented
Note None documented


procedure TAuthenticator.SetAuthenticateURL(const AURL:String);
Description: To be documented
Note None documented


function TAuthenticator.GetDeauthenticateURL:String;
Description: To be documented
Note None documented


procedure TAuthenticator.SetDeauthenticateURL(const AURL:String);
Description: To be documented
Note None documented


function TAuthenticator.CheckPassword(const APassword:String):LongWord;
Description: To be documented
Note None documented


function TAuthenticator.AddPassword(const APassword:String):LongWord;
Description: To be documented
Note None documented


function TAuthenticator.DeletePassword(const APassword:String):LongWord;
Description: To be documented
Note None documented


function TAuthenticator.CheckUsername(const AUsername:String):LongWord;
Description: To be documented
Note None documented


function TAuthenticator.CheckUserPassword(const AUsername,APassword:String):LongWord;
Description: To be documented
Note None documented


function TAuthenticator.AddUsername(const AUsername,APassword:String):LongWord;
Description: To be documented
Note None documented


function TAuthenticator.DeleteUsername(const AUsername,APassword:String):LongWord;
Description: To be documented
Note None documented


function TAuthenticator.CheckToken(const AToken,AValue:String):LongWord;
Description: To be documented
Note None documented


function TAuthenticator.CreateToken(const AValue:String; var AToken:String; ATimeout:LongWord):LongWord;
Description: To be documented
Note None documented


function TAuthenticator.DeleteToken(const AToken,AValue:String):LongWord;
Description: To be documented
Note None documented


function TAuthenticator.CheckKey(AData:Pointer; ASize:LongWord):LongWord;
Description: To be documented
Note None documented


Return to Unit Reference