#include <authentication.h>
Link against: noaipcclient.lib
class NokiaAccount::Authentication : public QObject, public QObject, public QObject |
Authentication Manager API.
Public Member Functions | |
---|---|
Authentication(const QString &, const QString &, const ConnectionDetail &, bool, QObject *) | |
~Authentication() | |
AccountInfo | account() |
QString | accountId(bool) |
int | accountType() |
void | cancelAsyncRequest(int) |
QByteArray | createSaslAuthResponse(QString &, const QString &, const QString &, const QString &, const QString &, const QString &, const QString &, const QString &) |
QString | createSignature(const QString &) |
QString | emailAddress() |
bool | isAuthenticated() |
bool | isNoAConfigured() |
bool | isPasswordRemembered() |
int | isServiceAllowed() |
QString | lastLoggedInIdentifier() |
QString | loginTimeStamp(const QString &) |
QString | noAAccountId(int) |
QString | oAuthTimeStamp() |
QString | operatorId() |
ErrorCode | removeAccountDetails() |
ErrorCode | removeCachedAccount() |
QDateTime | serverUTCTime() |
int | signIn(const QString &, const QString &, RememberMe) |
ErrorCode | signOut() |
TermsAcceptanceData | termsAcceptance() |
qint32 | timeSinceLastManualLogin() |
QString | token() |
QString | userId() |
QString | userName() |
Public Signals | |
---|---|
void | identityNotificationUpdate(ESSONotification, ESSONotifyStatusCode, QString) |
void | initialized(bool) |
void | requestFinished(ErrorCode, RequestType, int) |
void | tokenStateChanged(TokenState) |
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() |
Authentication manager private API.
The Authentication class object is used at the backend to sign-in and sign-out the Nokia Account. It also takes care if the password is to be remembered for the future logins.
The Authentication private implemenation class object is used at the backend to sign-in and sign-out the Nokia Account. It also takes care if the password is to be remembered for the future logins.
Authentication | ( | const QString & | consumerKey, |
const QString & | consumerSecret, | ||
const ConnectionDetail & | connectionDetail, | ||
bool | useAsync = false, | ||
QObject * | parent = 0 | ||
) |
Constructor
Constructor.
Parameters | |
---|---|
consumerKey | Consumer key. |
consumerSecret | Consumer secret. |
connectionDetail | Proxy connection details and timeout value. |
AccountInfo | account | ( | ) |
Account getter, returns the only cached account by the enabler. Account validity must be checked to ensure a valid account is returned.
Local account getter, returns the one and only cached account.
QString | accountId | ( | bool | aHashed = false | ) |
Returns the account Id of the signed in user Else returns an empty string. Returns the accountId of the user
Parameters | |
---|---|
aHashed | If "True" returns MD5 diagest of account Id |
int | accountType | ( | ) |
Fetches more details on the exact type of account for a given AccountIdentity while creating Authentication object. NOTE: This is primarily required for Federation cases, where in we have different types of account.
void | cancelAsyncRequest | ( | int | requestId = 0 | ) |
Cancels any outstanding asynchronous requests. Cancels a specific request if ID is given, if no id is passed all outstanding requests are cancelled.
Cancels any outstanding asynchronous requests.
Parameters | |
---|---|
requestId | Identifies the specific request to be cancelled. |
QByteArray | createSaslAuthResponse | ( | QString & | aClientNonce, |
const QString & | aServerNonce, | |||
const QString & | aDigestUri, | |||
const QString & | aNonceCount = SASL_NONCE_COUNT_VALUE , | |||
const QString & | aQop = SASL_QOP , | |||
const QString & | aCharset = SASL_CHARSET , | |||
const QString & | aUserName = QString(), | |||
const QString & | aRealm = SASL_REALM | |||
) |
Creates and returns the SASL auth response. If username and password values are not passed by caller, enabler will use current signed-in user credentials to create the SASL response.
If caller doesn't supply username ,password and enabler doesn't have user signed in returns QByteArray()
Creates and returns the SASL auth response .
Parameters | |
---|---|
aClientNonce | - OUT parameter - Base64 encoded 8 octet long binary buffer filled with random data resulting 12 (US-ASCII) characters. From security point of view this would be better to generate on the SSO DE side and return with the response. |
aServerNonce | - IN parameter - server nonce, to be provided by the API user |
aDigestUri | - IN parameter - digest uri, to be provided by the API user |
aNonceCount | - IN parameter - Nonce count, default is "00000001" |
aQop | - IN parameter - response-value validation supports "auth-int" and "auth-conf" values, no other logic logic is provided for them. Parameter should have default value should be used which is "auth" |
aCharset | - IN parameter - Indicates if the client has used ISO-8859-1, or UTF-8 encoding when hashing username and password for response-value calculation. Default value should be "". |
aRealm | - IN parameter - "ovi.com" by default but should not be hardcoded and value should be provided by API user |
QString | createSignature | ( | const QString & | strBaseMsg | ) |
Creates and returns the signature. The signature is created using the consumerSecret and tokenSecret.
Creates and returns the signature .
Parameters | |
---|---|
strBaseMsg | The message to be signed/encrypted. |
QString | emailAddress | ( | ) |
Returns the emailid from the token creation response information Else returns an empty string. Returns cached emailId
void | identityNotificationUpdate | ( | ESSONotification | notificationType, |
ESSONotifyStatusCode | statusCode, | |||
QString | aMessage | |||
) | [signal] |
void | initialized | ( | bool | isInitialized | ) | [signal] |
bool | isAuthenticated | ( | ) |
Returns true/false depending on whether the user is authenticated or not but based on the federated or non-federated client sessions. Returns whether the user is authenticated or not.
bool | isNoAConfigured | ( | ) |
Returns true/false depending on whether the user is authenticated or not for the NOA account.
Returns whether the user is authenticated or not.
bool | isPasswordRemembered | ( | ) |
Returns true/false depending on whether the enabler remembers the user password or not.
Returns whether the enabler remember the password.
int | isServiceAllowed | ( | ) |
Is the client service application (eg: "ovistore", "ovimusic", "ovimaps", etc..) allowed to use given Identity type. (ORANGE,VODAFONE,... etc) For Orange Federation, Only OVI Store is allowed to use this type. NOTE: 1. DE will do a string comparison of serviceId provided in Identity Preference during constructor against the service Id specified in the provisioning response message. 2. If service is not allowed to use requested Identity Preference in constructor, all other accessor API's will return failure.
Is the client service application (eg: "ovistore", "ovimusic", "ovimaps", etc..) allowed to use given Identity type. (ORANGE,VODAFONE,... etc) For Orange Federation, Only OVI Store is allowed to use this type. NOTE: 1. DE will do a string comparison of serviceId provided in Identity Preference during constructor against the service Id specified in the provisioning response message. 2. If service is not allowed to use requested Identity Preference in constructor, all other accessor API's will return failure.
QString | lastLoggedInIdentifier | ( | ) |
Returns the login Identifier(username or email) with which signin was called if the password is remembered/ session is active. Else returns empty. Returns cached loginId
QString | loginTimeStamp | ( | const QString & | consumerKey = 0 | ) |
Gets the last logged in timestamp for the given consumer key from the cache. it returns empty string if last login timestamp doenst exists in cache. If the consumer key is not passed, returns the last user's logged in timestamp from the persistent storage.
Parameters | |
---|---|
consumerKey | - consumerKey of the client application. |
QString | noAAccountId | ( | int | hashType | ) |
Get the NoA Unique ID. This id is ALWAYS unique across all accounts. This ID is generated by Server, when a new account is created. Applications can be get SHA1 hash of this value as well.
Precondition: SignIn should be successful, before calling this API.
See also: noAAccountIdResponse signal for retrieving data : Change INPUT param to enumeration -AccountIdHash
Returns the accountId of the user
QString | oAuthTimeStamp | ( | ) |
Returns the synchronised SSO Backend timestamp to be used as OAuth timestamp by clients. This api has to be used only after sign in.Calling this API without signing in will return current time.
QString | operatorId | ( | ) |
Fetches the operatorID defined in the provisioning message for the configured Account Preference. Returned String (eg: "orange.uk" or "orange.fr" can help service clients in defining customized UI. NOTE: This information is only available post service is initialized & provisioned Fetches the operatorID defined in the provisioning message for the configured Account Preference. Returned String (eg: "orange.uk" or "orange.fr" can help service clients in defining customized UI. NOTE: This information is only available post service is initialized & provisioned
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. errorNone if no error occured. |
requestType | Indicates the Requested operation type. |
requestId | The request id for which the signal is generated. |
QDateTime | serverUTCTime | ( | ) |
Gets the SSO Server time in UTC. This api has to be used only after sign in.Calling this API without signing in will return current time.
int | signIn | ( | const QString & | password = 0, |
const QString & | userId = 0, | |||
RememberMe | rememberMe = rememberMeTrue | |||
) |
Asynchronously signs-in the user to the backend. Signal indicates success or failure. If the user is already signed-in, the backend calls are not made & the API returns with a success status.
Asynchronously signs-in the user.
Parameters | |
---|---|
password | Account password. If the password is not passed, then the enabler tries to use the cached password. |
userId | User name for the account. If not passed cached user name will be used. |
rememberMe | Remember Me Enum value to determine whether user credentials to be remembered for the session or not. |
ErrorCode | signOut | ( | ) |
Signs the user out from the account. Deletes the associated token from cache.
Signs the user out and notifies all clients.
TermsAcceptanceData | termsAcceptance | ( | ) |
Returns the retrieved terms acceptance data.
Returns the terms acceptance info .
qint32 | timeSinceLastManualLogin | ( | ) |
Time elapsed since last successful manual login. Manual login,is when user has entered password forauthentication. It is not when application signs in user bydefault without user intervention.
This value shall be in seconds.
See also: timeSinceLastManualLoginResponse signal for retrieving data
Pre-requisite: User should be Signed In
Returns the time since last manual login .
QString | token | ( | ) |
Returns the current token. Token will always be refreshed by the enabler automaticaly. The client need not worry about the validity of the token. This call will not generate new token, and hence does not connect to backend.
Returns the current token.
void | tokenStateChanged | ( | TokenState | tokenState | ) | [signal] |
Notification to the client, about any change in the state of the access token e.g. if token has expired or been deleted.