kio Library API Documentation

KIO::AuthInfo Class Reference

This class is intended to make it easier to prompt for, cache and retrieve authorization information. A two way messaging class for passing authentication information. More...

#include <authinfo.h>

List of all members.

Public Methods

 AuthInfo ()
 Default constructor.

 AuthInfo (const AuthInfo &info)
 Copy constructor.

AuthInfo & operator= (const AuthInfo &info)
 Overloaded equal to operator.

bool isModified () const
 Use this method to check if the object was modified.

void setModified (bool flag)
 Use this method to indicate that this object has been modified.


Public Attributes

KURL url
 The URL for which authentication is to be stored.

QString username
 This setting is required for caching.

QString password
 This setting is required for caching.

QString prompt
 Information to be displayed when prompting the user for authentication information.

QString caption
 The text to displayed in the title bar of the password prompting dialog.

QString comment
 Additional comment to be displayed when prompting the user for authentication information.

QString commentLabel
 Descriptive label to be displayed in front of the comment when prompting the user for password.

QString realmValue
 A unique identifier that allows caching of multiple passwords for different resources in the same server.

QString digestInfo
 Field to store any extra authentication information for protocols that need it (ex: http).

bool verifyPath
 Flag that, if set, indicates whether a path match should be performed when requesting for cached authorization.

bool readOnly
 Flag which if set forces the username field to be read-only.

bool keepPassword
 Flag to indicate the persistence of the given password.


Detailed Description

This class is intended to make it easier to prompt for, cache and retrieve authorization information. A two way messaging class for passing authentication information.

When using this class to cache, retrieve or prompt authentication information, you only need to set the necessary attributes. For example, to check whether a password is already cached, the only required information is the URL of the resource and optionally whether or not a path match should be performed. Similarly, to prompt for password you only need to optionally set the prompt, username (if already supplied), comment and commentLabel fields.

<u>SPECIAL NOTE:</u> If you extend this class to add additional paramters do not forget to overload the stream insertion and extraction operators ("<<" and ">>") so that the added data can be correctly serialzed.

Author:
Dawit Alemayehu <adawit@kde.org>

Definition at line 51 of file authinfo.h.


Constructor & Destructor Documentation

AuthInfo::AuthInfo  
 

Default constructor.

Definition at line 43 of file authinfo.cpp.

References keepPassword, readOnly, and verifyPath.

AuthInfo::AuthInfo const AuthInfo &    info
 

Copy constructor.

Definition at line 51 of file authinfo.cpp.


Member Function Documentation

AuthInfo & AuthInfo::operator= const AuthInfo &    info
 

Overloaded equal to operator.

Definition at line 56 of file authinfo.cpp.

References caption, comment, commentLabel, digestInfo, keepPassword, modified, password, prompt, readOnly, realmValue, url, username, and verifyPath.

bool KIO::AuthInfo::isModified   const [inline]
 

Use this method to check if the object was modified.

Definition at line 75 of file authinfo.h.

Referenced by KIO::SlaveBase::checkCachedAuthentication(), and KIO::SlaveBase::openPassDlg().

void KIO::AuthInfo::setModified bool    flag [inline]
 

Use this method to indicate that this object has been modified.

Definition at line 80 of file authinfo.h.


Member Data Documentation

KURL KIO::AuthInfo::url
 

The URL for which authentication is to be stored.

This field is required when attempting to cache authorization and retrieve it. However, it is not needed when prompting the user for authorization info.

This setting is required except when prompting the user for password.

Definition at line 92 of file authinfo.h.

Referenced by KIO::SlaveBase::checkCachedAuthentication(), and operator=().

QString KIO::AuthInfo::username
 

This setting is required for caching.

Definition at line 97 of file authinfo.h.

Referenced by KIO::SlaveInterface::openPassDlg(), KIO::SlaveBase::openPassDlg(), and operator=().

QString KIO::AuthInfo::password
 

This setting is required for caching.

Definition at line 102 of file authinfo.h.

Referenced by operator=().

QString KIO::AuthInfo::prompt
 

Information to be displayed when prompting the user for authentication information.

<u>NOTE:</u>If this field is not set, the authentication dialog simply displays the preset default prompt.

This setting is optional and empty by default.

Definition at line 113 of file authinfo.h.

Referenced by KIO::SlaveInterface::openPassDlg(), and operator=().

QString KIO::AuthInfo::caption
 

The text to displayed in the title bar of the password prompting dialog.

<u>NOTE:</u>If this field is not set, the authentication dialog simply displays the preset default caption.

This setting is optional and empty by default.

Definition at line 124 of file authinfo.h.

Referenced by KIO::SlaveInterface::openPassDlg(), and operator=().

QString KIO::AuthInfo::comment
 

Additional comment to be displayed when prompting the user for authentication information.

This field allows you to display a short (no more than 80 characters) extra description in the password prompt dialog. For example, this field along with the commentLabel can be used to describe the server that requested the authentication:

  Server:   Squid Proxy @ foo.com
  

where "Server:" is the commentLabel and the rest is the actual comment. Note that it is always better to use the commentLabel field as it will be placed properly in the dialog rather than to include it within the actual comment.

This setting is optional and empty by default.

Definition at line 148 of file authinfo.h.

Referenced by KIO::SlaveInterface::openPassDlg(), and operator=().

QString KIO::AuthInfo::commentLabel
 

Descriptive label to be displayed in front of the comment when prompting the user for password.

This setting is optional and only applicable when the comment field is also set.

Definition at line 157 of file authinfo.h.

Referenced by KIO::SlaveInterface::openPassDlg(), and operator=().

QString KIO::AuthInfo::realmValue
 

A unique identifier that allows caching of multiple passwords for different resources in the same server.

Mostly this setting is applicable to the HTTP protocol whose authentication scheme explicitly defines the use of such a unique key. However, any protocol that can generate or supply a unique id can effectively use it to distinguish passwords.

(If you are instead interested in caching the authentication info for multiple users to the same server, refer to multipleUserCaching below)

This setting is optional and not set by default.

Definition at line 175 of file authinfo.h.

Referenced by operator=().

QString KIO::AuthInfo::digestInfo
 

Field to store any extra authentication information for protocols that need it (ex: http).

This setting is optional and mostly applicable for HTTP protocol. However, any protocol can make use of it to store extra info.

Definition at line 185 of file authinfo.h.

Referenced by operator=().

bool KIO::AuthInfo::verifyPath
 

Flag that, if set, indicates whether a path match should be performed when requesting for cached authorization.

A path is deemed to be a match if it is equal to or is a subset of the cached path. For example, if stored path is "/foo/bar" and the request's path set to "/foo/bar/acme", then it is a match whereas it would not if the request's path was set to "/foo".

This setting is optional and false by default.

Definition at line 198 of file authinfo.h.

Referenced by AuthInfo(), and operator=().

bool KIO::AuthInfo::readOnly
 

Flag which if set forces the username field to be read-only.

This setting is optional and false by default.

Definition at line 205 of file authinfo.h.

Referenced by AuthInfo(), KIO::SlaveInterface::openPassDlg(), and operator=().

bool KIO::AuthInfo::keepPassword
 

Flag to indicate the persistence of the given password.

This is a two-way flag, when set before calling openPassDlg it makes the "keep Password" check box visible to the user. In return the flag will indicate the state of the check box. By default if the flag is checked the password will be cached for the entire life of the current KDE session otherwise the cached password is deleted right after the application using it has been closed.

Definition at line 218 of file authinfo.h.

Referenced by AuthInfo(), and operator=().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:21:38 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001