NokiaAccount::PasswordManager Class Reference

#include <mw/noa/passwordmanager.h>

class NokiaAccount::PasswordManager : public QObject, public QObject, public QObject

Password Manager API.

Inherits from

  • NokiaAccount::PasswordManager
    Public Member Functions
    PasswordManager(const QString &, const QString &, const ConnectionDetail &, bool, QObject *)
    ~PasswordManager()
    voidcancelAsyncRequest(int)
    QPixmap captchaImage()
    intchangePassword(const QString &, const QString &)
    Strength passwordStrength(const QString &)
    intresetPassword(const QString &, const QString &)
    intretrieveCaptchaImage(const QSize &)
    intretrieveSecurityQuestion(const QString &, const QLocale::Language &)
    intretrieveSecurityQuestion(const QString &, const QString &)
    QString securityQuestion()
    intsendResetMessage(const QString &, const QString &, bool, const QString &)
    boolverifyPasswordToSetUserName(const QString &, const QString &)
    Public Signals
    voidinitialized(bool)
    voidrequestFinished(ErrorCode, RequestType, int)
    Inherited Attributes
    QObject::objectName
    QObject::staticQtMetaObject
    Inherited Functions
    QObject::QObject(QObjectPrivate &,QObject *)
    QObject::blockSignals(bool)
    QObject::childEvent(QChildEvent *)
    QObject::children()const
    QObject::connect(const QObject *,const QMetaMethod &,const QObject *,const QMetaMethod &,Qt::ConnectionType)
    QObject::connect(const QObject *,const char *,const QObject *,const char *,Qt::ConnectionType)
    QObject::connect(const QObject *,const char *,const char *,Qt::ConnectionType)const
    QObject::connectNotify(const char *)
    QObject::customEvent(QEvent *)
    QObject::deleteLater
    QObject::destroyed
    QObject::disconnect(const QObject *,const QMetaMethod &,const QObject *,const QMetaMethod &)
    QObject::disconnect(const QObject *,const char *)
    QObject::disconnect(const QObject *,const char *,const QObject *,const char *)
    QObject::disconnect(const char *,const QObject *,const char *)
    QObject::disconnectNotify(const char *)
    QObject::dumpObjectInfo()
    QObject::dumpObjectTree()
    QObject::dynamicPropertyNames()const
    QObject::event(QEvent *)
    QObject::eventFilter(QObject *,QEvent *)
    QObject::findChild(const QString &)const
    QObject::findChildren(const QRegExp &)const
    QObject::findChildren(const QString &)const
    QObject::inherits(const char *)const
    QObject::installEventFilter(QObject *)
    QObject::isWidgetType()const
    QObject::killTimer(int)
    QObject::moveToThread(QThread *)
    QObject::objectName()const
    QObject::parent()const
    QObject::property(const char *)const
    QObject::receivers(const char *)const
    QObject::registerUserData()
    QObject::removeEventFilter(QObject *)
    QObject::sender()const
    QObject::senderSignalIndex()const
    QObject::setObjectName(const QString &)
    QObject::setParent(QObject *)
    QObject::setProperty(const char *,const QVariant &)
    QObject::setUserData(uint,QObjectUserData *)
    QObject::signalsBlocked()const
    QObject::startTimer(int)
    QObject::thread()const
    QObject::timerEvent(QTimerEvent *)
    QObject::userData(uint)const
    QObject::~QObject()

    Detailed Description

    The PasswordManager class is responsible for all the tasks related to passwords. It can be used to set, reset, change and retrieve password. The class also provides an API to get the Captcha image from the backend for the text provided.

    Constructor & Destructor Documentation

    PasswordManager ( const QString &, const QString &, const ConnectionDetail &, bool, QObject * )

    PasswordManager(const QString &consumerKey,
    const QString &consumerSecret,
    const ConnectionDetail &connectionDetail,
    booluseAsync = false,
    QObject *parent = 0
    )

    Constructor

    Constructor.

    Parameters
    consumerKeyConsumer key of the client application.
    consumerSecretConsumer secret of the client application.
    connectionDetailProxy connection details and timeout value.

    ~PasswordManager ( )

    ~PasswordManager()

    Destructor

    Destructor.

    Member Function Documentation

    cancelAsyncRequest ( int )

    voidcancelAsyncRequest(intrequestId = 0)

    Cancels any outstanding asynchronous requests. Cancels a specific request if ID is given, if none all outstanding requests are cancelled.

    Cancels any outstanding asynchronous requests.

    Parameters
    requestIdIdentifies the specific request to be cancelled.

    captchaImage ( )

    QPixmap captchaImage()

    Gets the retrieved captcha image.

    Gets the retrieved captcha image.

    Return Value
    Captcha image as a QPixmap object.

    changePassword ( const QString &, const QString & )

    intchangePassword(const QString &oldPassword,
    const QString &newPassword
    )

    Changes the password from old to new one. Request status is returned via a signal. Sends the change password information to the backend

    Parameters
    oldPasswordold password which is checked at the enabler
    newPasswordNew password entered by the user
    Return Value
    A unique identifier for this request. -1, if NoA enabler encounters internal error, in this case enabler doesn't emit requestFinished signal.

    initialized ( bool )

    voidinitialized(boolisInitialized)[signal]

    passwordStrength ( const QString & )

    Strength passwordStrength(const QString &password)

    Returns the strength of the password. The value returned is an enum indicating whether the password is weak,medium,strong,too short or too long. By default it returns unknown strength when the password passed is empty.

    Returns the strength of the password.

    Parameters
    passwordwhose strength has to be measured.
    Return Value
    Strength of the password.

    requestFinished ( ErrorCode, RequestType, int )

    voidrequestFinished(ErrorCodeerror,
    RequestTyperequestType,
    intrequestId
    )[signal]

    Signal to indicate that the specified request id has finished.

    Parameters
    errorIndicates the type of error or ErrNone.
    requestTypeIndicates the Requested operation type.
    requestIdThe request id for which the signal is generated.

    resetPassword ( const QString &, const QString & )

    intresetPassword(const QString &securityAnswer,
    const QString &newPassword
    )

    Final reset password call in the password recovery process to the backend. Request status is returned via a signal. Sends the reset password information to the backend

    Parameters
    securityAnswerAnswer to the security question
    newPasswordNew password entered by the user
    Return Value
    A unique identifier for this request. -1, if NoA enabler encounters internal error, in this case enabler doesn't emit requestFinished signal.

    retrieveCaptchaImage ( const QSize & )

    intretrieveCaptchaImage(const QSize &size =  DEFAULTCAPTCHASIZE )

    Retrieve captcha image from backend. Request status is returned via a signal. Once the signal is received, the client needs to call captchaImage(). Optional size can be specified in terms of width and height limits min = 10 and max = 700. Default is 200 x 50.

    Retrieve captcha image from backend.

    Parameters
    sizeOptionally specify the required size of the captcha image.
    Return Value
    A unique identifier for this request. -1, if NoA enabler encounters internal error, in this case enabler doesn't emit requestFinished signal.

    retrieveSecurityQuestion ( const QString &, const QLocale::Language & )

    intretrieveSecurityQuestion(const QString &securityToken,
    const QLocale::Language &language
    )

    Retrieve the security question. Request status is returned via a signal. Once the signal is received the client should call securityQuestion(), to retrieve the list. Retrieve the security question.

    Parameters
    securityTokenIts the security token returned to the user as a result of the initiation of the password recovery process. Enabler will cache it for further use in the recovery process.
    languageLanguage code in which security questions should be localized.
    Return Value
    A unique identifier for this request. -1, if NoA enabler encounters internal error, in this case enabler doesn't emit requestFinished signal.

    retrieveSecurityQuestion ( const QString &, const QString & )

    intretrieveSecurityQuestion(const QString &securityToken,
    const QString &language
    )

    Retrieve the security question. Request status is returned via a signal. Once the signal is received the client should call securityQuestion(), to retrieve the list.

    Parameters
    securityTokenIts the security token returned to the user as a result of the initiation of the password recovery process. Enabler will cache it for further use in the recovery process.
    languageLanguage string code in which security questions should be localized. language string is validated at the enabler,if the language string is invalid (not as BCP-format),it emits the requestFinished signal with errorInvalidLanguage.
    Return Value
    A unique identifier for this request. -1, if NoA enabler encounters internal error, in this case enabler doesn't emit requestFinished signal.

    securityQuestion ( )

    QString securityQuestion()

    Returns the retrieved security question.

    Returns the retrieved security question.

    Return Value
    Returns the security question as a localized QString.

    sendResetMessage ( const QString &, const QString &, bool, const QString & )

    intsendResetMessage(const QString &captchaText,
    const QString &contactInfo,
    boolasLink = true,
    const QString &messageBody = 0
    )

    Sends password reset message to the backend. Sends the captcha text to the backend

    Parameters
    captchaTextCaptcha text entered by the user.
    contactInfoEmail address or mobile number at which the user wants to receive the reset message.
    asLinkif set true ,Sends password reset message to email/phonenumber as a link otherwise. sends as plain text token.
    messageBodyClients can optionally create a custom mmessage. [More info]
    Return Value
    A unique identifier for this request. -1, if NoA enabler encounters internal error, in this case enabler doesn't emit requestFinished signal.

    verifyPasswordToSetUserName ( const QString &, const QString & )

    boolverifyPasswordToSetUserName(const QString &password,
    const QString &username
    )

    Verifies password before setting the username

    Parameters
    passwordwhich is checked at the enabler
    usernameusername to be set
    Return Value
    true if password is correct else return false