Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QAuthenticator Class Reference

The QAuthenticator class provides an authentication object. More...

 #include <QAuthenticator>

Note: All functions in this class are reentrant.

This class was introduced in Qt 4.3.

Public Functions

QAuthenticator ()
QAuthenticator ( const QAuthenticator & other )
~QAuthenticator ()
bool isNull () const
QVariant option ( const QString & opt ) const
QVariantHash options () const
QString password () const
QString realm () const
void setOption ( const QString & opt, const QVariant & value )
void setPassword ( const QString & password )
void setUser ( const QString & user )
QString user () const
bool operator!= ( const QAuthenticator & other ) const
QAuthenticator & operator= ( const QAuthenticator & other )
bool operator== ( const QAuthenticator & other ) const

Detailed Description

The QAuthenticator class provides an authentication object.

The QAuthenticator class is usually used in the authenticationRequired() and proxyAuthenticationRequired() signals of QNetworkAccessManager and QAbstractSocket. The class provides a way to pass back the required authentication information to the socket when accessing services that require authentication.

QAuthenticator supports the following authentication methods:

  • Basic
  • NTLM version 1
  • Digest-MD5

Note that, in particular, NTLM version 2 is not supported.

Options

In addition to the username and password required for authentication, a QAuthenticator object can also contain additional options. The options() function can be used to query incoming options sent by the server; the setOption() function can be used to set outgoing options, to be processed by the authenticator calculation. The options accepted and provided depend on the authentication type (see method()).

The following tables list known incoming options as well as accepted outgoing options. The list of incoming options is not exhaustive, since servers may include additional information at any time. The list of outgoing options is exhaustive, however, and no unknown options will be treated or sent back to the server.

Basic

OptionDirectionDescription
realmIncomingContains the realm of the authentication, the same as realm()

The Basic authentication mechanism supports no outgoing options.

NTLM version 1

The NTLM authentication mechanism currently supports no incoming or outgoing options.

Digest-MD5

OptionDirectionDescription
realmIncomingContains the realm of the authentication, the same as realm()

The Digest-MD5 authentication mechanism supports no outgoing options.

See also QSslSocket.

Member Function Documentation

QAuthenticator::QAuthenticator ()

Constructs an empty authentication object

QAuthenticator::QAuthenticator ( const QAuthenticator & other )

Constructs a copy of other.

QAuthenticator::~QAuthenticator ()

Destructs the object

bool QAuthenticator::isNull () const

Returns true if the authenticator is null.

QVariant QAuthenticator::option ( const QString & opt ) const

Returns the value related to option opt if it was set by the server. See QAuthenticator#Options for more information on incoming options. If option opt isn't found, an invalid QVariant will be returned.

This function was introduced in Qt 4.7.

See also setOption(), options(), and QAuthenticator#Options.

QVariantHash QAuthenticator::options () const

Returns all incoming options set in this QAuthenticator object by parsing the server reply. See QAuthenticator#Options for more information on incoming options.

This function was introduced in Qt 4.7.

See also option() and QAuthenticator#Options.

QString QAuthenticator::password () const

returns the password used for authentication.

See also setPassword().

QString QAuthenticator::realm () const

returns the realm requiring authentication.

void QAuthenticator::setOption ( const QString & opt, const QVariant & value )

Sets the outgoing option opt to value value. See QAuthenticator#Options for more information on outgoing options.

This function was introduced in Qt 4.7.

See also options(), option(), and QAuthenticator#Options.

void QAuthenticator::setPassword ( const QString & password )

Sets the password used for authentication.

See also password().

void QAuthenticator::setUser ( const QString & user )

Sets the user used for authentication.

See also user().

QString QAuthenticator::user () const

returns the user used for authentication.

See also setUser().

bool QAuthenticator::operator!= ( const QAuthenticator & other ) const

Returns true if this authenticator is different from other; otherwise returns false.

QAuthenticator & QAuthenticator::operator= ( const QAuthenticator & other )

Assigns the contents of other to this authenticator.

bool QAuthenticator::operator== ( const QAuthenticator & other ) const

Returns true if this authenticator is identical to other; otherwise returns false.

Publicit�

Best Of

Actualit�s les plus lues

Semaine
Mois
Ann�e
  1. � Quelque chose ne va vraiment pas avec les d�veloppeurs "modernes" �, un d�veloppeur � "l'ancienne" critique la multiplication des biblioth�ques 44
  2. Microsoft ouvre aux autres compilateurs C++ AMP, la sp�cification pour la conception d'applications parall�les C++ utilisant le GPU 22
  3. Les d�veloppeurs ignorent-ils trop les failles d�couvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. RIM : � 13 % des d�veloppeurs ont gagn� plus de 100 000 $ sur l'AppWord �, Qt et open-source au menu du BlackBerry DevCon Europe 0
  5. BlackBerry 10 : premi�res images du prochain OS de RIM qui devrait int�grer des widgets et des tuiles inspir�es de Windows Phone 0
  6. Quelles nouveaut�s de C++11 Visual C++ doit-il rapidement int�grer ? Donnez-nous votre avis 10
  7. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil d�claratif et extensible pour la compilation de projets Qt 17
Page suivante

Le blog Digia au hasard

Logo

D�ploiement d'applications Qt Commercial sur les tablettes Windows 8

Le blog Digia est l'endroit privil�gi� pour la communication sur l'�dition commerciale de Qt, o� des r�ponses publiques sont apport�es aux questions les plus pos�es au support. Lire l'article.

Communaut�

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la r�daction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, �crite par Nokia Corporation and/or its subsidiary(-ies). Les �ventuels probl�mes r�sultant d'une mauvaise traduction ne sont pas imputables � Nokia. Qt 4.7
Copyright © 2012 Developpez LLC. Tous droits r�serv�s Developpez LLC. Aucune reproduction, m�me partielle, ne peut �tre faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'� 3 ans de prison et jusqu'� 300 000 E de dommages et int�r�ts. Cette page est d�pos�e � la SACD.
Vous avez d�nich� une erreur ? Un bug ? Une redirection cass�e ? Ou tout autre probl�me, quel qu'il soit ? Ou bien vous d�sirez participer � ce projet de traduction ? N'h�sitez pas � nous contacter ou par MP !
 
 
 
 
Partenaires

H�bergement Web