Indy 9 | Content | Index | Reference

TIdBasicAuthentication
Hierarchy, Properties, Methods, See Also, Unit: IdAuthentication
Implements the HTTP Basic Authentication scheme.

    TIdBasicAuthentication = class(TIdAuthentication)

Unit
IdAuthentication
Description
TIdBasicAuthentication is a TIdAuthentication descendant that implements the specifics of the HTTP Basic Authentication scheme, as described in the Internet Standards document:

- RFC 2617 - HTTP Authentication: Basic and Digest Access Authentication (http://www.rfc-editor.org/rfc/rfc2617.txt)

TIdBasicAuthentication is based on the model where a client must authenticate for each unique Realm on a server. TIdBasicAuthentication is used in response to a challenge header in the form:

          WWW-Authenticate: Basic realm="URISpace"

To receive authorization, the client sends the Username and Password, separated by a single colon (":") character, within a base64 encoded string in the Authentiction credentials. Username might be case sensitive.

TIdBasicAuthentication.Realm
TIdBasicAuthentication, See Also
Identifies the proptection space for the authentication scheme.

    property Realm: String;

Description
Realm is a String property that identifies the protection space being accessed that has its own authentication scheme and/or authorization database. Realm is assigned by the origin server as a parameter in the WWW-Authenticate challenge header stored in authentication parameters.

TIdBasicAuthentication.Authentication
TIdBasicAuthentication, See Also
Creates the authorization scheme and credentials for the authentication class.

    function Authentication: String; override;

Return Value
String - Scheme and Base64-encoded credentials for the process.
Description
Authentication is an overriden String function that implements creation of the authorization credentials for the Basic Authentication scheme, and returned as a Base64-encoded string. Authentication normally returns a value in the form:

          Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

TIdBasicAuthentication.Create
TIdBasicAuthentication, See Also
Constructor for the object instance.

    constructor Create; override;

Description
Create is the constructor for the object instance. Create calls the inherited Create method. Create also assigns the default value for the internal property used to maintain the current step in the authentication process.

TIdBasicAuthentication.KeepAlive
TIdBasicAuthentication
Indicates that Keep-Alive signals are supported for the authentication mechanism.

    function KeepAlive: Boolean; override;

Description
KeepAlive is an Boolean function that specifies the function used to indicate if the authentication mechanism supports use of the KEEP-ALIVE header. When KeepAlive is True, the authentication mechanism allows use of the header to prevent loss of a connection during authentication processing.

TIdBasicAuthentication.Reset
TIdBasicAuthentication
Clears the number of retries for the authentication mechanism.

    procedure Reset; override;

Description
Reset is a procedure that clears the number of retry attempts performed using the authentication mechanism. Reset sets the value of the internal status flag to 0 indicating that no authentication has been performed.

Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.