#include <mw/noa/passwordmanager.h>
class NokiaAccount::PasswordManager : public QObject, public QObject, public QObject |
Password Manager API.
Public Member Functions | |
---|---|
PasswordManager(const QString &, const QString &, const ConnectionDetail &, bool, QObject *) | |
~PasswordManager() | |
void | cancelAsyncRequest(int) |
QPixmap | captchaImage() |
int | changePassword(const QString &, const QString &) |
Strength | passwordStrength(const QString &) |
int | resetPassword(const QString &, const QString &) |
int | retrieveCaptchaImage(const QSize &) |
int | retrieveSecurityQuestion(const QString &, const QLocale::Language &) |
int | retrieveSecurityQuestion(const QString &, const QString &) |
QString | securityQuestion() |
int | sendResetMessage(const QString &, const QString &, bool, const QString &) |
bool | verifyPasswordToSetUserName(const QString &, const QString &) |
Public Signals | |
---|---|
void | initialized(bool) |
void | requestFinished(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() |
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.
PasswordManager | ( | const QString & | consumerKey, |
const QString & | consumerSecret, | ||
const ConnectionDetail & | connectionDetail, | ||
bool | useAsync = false, | ||
QObject * | parent = 0 | ||
) |
Constructor
Constructor.
Parameters | |
---|---|
consumerKey | Consumer key of the client application. |
consumerSecret | Consumer secret of the client application. |
connectionDetail | Proxy connection details and timeout value. |
void | cancelAsyncRequest | ( | int | requestId = 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 | |
---|---|
requestId | Identifies the specific request to be cancelled. |
QPixmap | captchaImage | ( | ) |
Gets the retrieved captcha image.
Gets the retrieved captcha image.
int | changePassword | ( | 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 | |
---|---|
oldPassword | old password which is checked at the enabler |
newPassword | New password entered by the user |
void | initialized | ( | bool | isInitialized | ) | [signal] |
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 | |
---|---|
password | whose strength has to be measured. |
void | requestFinished | ( | ErrorCode | error, |
RequestType | requestType, | |||
int | requestId | |||
) | [signal] |
Signal to indicate that the specified request id has finished.
Parameters | |
---|---|
error | Indicates the type of error or ErrNone. |
requestType | Indicates the Requested operation type. |
requestId | The request id for which the signal is generated. |
int | resetPassword | ( | 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 | |
---|---|
securityAnswer | Answer to the security question |
newPassword | New password entered by the user |
int | retrieveCaptchaImage | ( | 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 | |
---|---|
size | Optionally specify the required size of the captcha image. |
int | retrieveSecurityQuestion | ( | 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 | |
---|---|
securityToken | Its 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. |
language | Language code in which security questions should be localized. |
int | retrieveSecurityQuestion | ( | 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 | |
---|---|
securityToken | Its 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. |
language | Language 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. |
QString | securityQuestion | ( | ) |
Returns the retrieved security question.
Returns the retrieved security question.
int | sendResetMessage | ( | const QString & | captchaText, |
const QString & | contactInfo, | |||
bool | asLink = true, | |||
const QString & | messageBody = 0 | |||
) |
Sends password reset message to the backend. Sends the captcha text to the backend
Parameters | |
---|---|
captchaText | Captcha text entered by the user. |
contactInfo | Email address or mobile number at which the user wants to receive the reset message. |
asLink | if set true ,Sends password reset message to email/phonenumber as a link otherwise. sends as plain text token. |
messageBody | Clients can optionally create a custom mmessage. [More info] |
bool | verifyPasswordToSetUserName | ( | const QString & | password, |
const QString & | username | |||
) |
Verifies password before setting the username
Parameters | |
---|---|
password | which is checked at the enabler |
username | username to be set |