NokiaAccount::Authentication Class Reference

#include <authentication.h>

Link against: noaipcclient.lib

class NokiaAccount::Authentication : public QObject, public QObject, public QObject

Authentication Manager API.

Inherits from

  • NokiaAccount::Authentication
    Public Member Functions
    Authentication(const QString &, const QString &, const ConnectionDetail &, bool, QObject *)
    ~Authentication()
    AccountInfo account()
    QString accountId(bool)
    intaccountType()
    voidcancelAsyncRequest(int)
    QByteArray createSaslAuthResponse(QString &, const QString &, const QString &, const QString &, const QString &, const QString &, const QString &, const QString &)
    QString createSignature(const QString &)
    QString emailAddress()
    boolisAuthenticated()
    boolisNoAConfigured()
    boolisPasswordRemembered()
    intisServiceAllowed()
    QString lastLoggedInIdentifier()
    QString loginTimeStamp(const QString &)
    QString noAAccountId(int)
    QString oAuthTimeStamp()
    QString operatorId()
    ErrorCode removeAccountDetails()
    ErrorCode removeCachedAccount()
    QDateTime serverUTCTime()
    intsignIn(const QString &, const QString &, RememberMe)
    ErrorCode signOut()
    TermsAcceptanceData termsAcceptance()
    qint32 timeSinceLastManualLogin()
    QString token()
    QString userId()
    QString userName()
    Public Signals
    voididentityNotificationUpdate(ESSONotification, ESSONotifyStatusCode, QString)
    voidinitialized(bool)
    voidrequestFinished(ErrorCode, RequestType, int)
    voidtokenStateChanged(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()

    Detailed Description

    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.

    Constructor & Destructor Documentation

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

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

    Constructor

    Constructor.

    Parameters
    consumerKeyConsumer key.
    consumerSecretConsumer secret.
    connectionDetailProxy connection details and timeout value.

    ~Authentication ( )

    ~Authentication()

    Destructor

    Destructor.

    Member Function Documentation

    account ( )

    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.

    Return Value
    Cached account details.

    accountId ( bool )

    QString accountId(boolaHashed = false)

    Returns the account Id of the signed in user Else returns an empty string. Returns the accountId of the user

    Parameters
    aHashedIf "True" returns MD5 diagest of account Id
    Return Value
    account Id. (plain or diagest depends on input)

    accountType ( )

    intaccountType()

    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.

    Return Value
    int value of SSOAccountCategoryType

    cancelAsyncRequest ( int )

    voidcancelAsyncRequest(intrequestId = 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
    requestIdIdentifies the specific request to be cancelled.

    createSaslAuthResponse ( QString &, const QString &, const QString &, const QString &, const QString &, const QString &, const QString &, const QString & )

    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
    Return Value
    The created SASL response as a QByteArray.

    createSignature ( const QString & )

    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
    strBaseMsgThe message to be signed/encrypted.
    Return Value
    The created signature as a QString.

    emailAddress ( )

    QString emailAddress()

    Returns the emailid from the token creation response information Else returns an empty string. Returns cached emailId

    Return Value
    emailId.

    identityNotificationUpdate ( ESSONotification, ESSONotifyStatusCode, QString )

    voididentityNotificationUpdate(ESSONotificationnotificationType,
    ESSONotifyStatusCodestatusCode,
    QStringaMessage
    )[signal]

    initialized ( bool )

    voidinitialized(boolisInitialized)[signal]

    isAuthenticated ( )

    boolisAuthenticated()

    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.

    Return Value
    Returns True if user is authenticated, else False.

    isNoAConfigured ( )

    boolisNoAConfigured()

    Returns true/false depending on whether the user is authenticated or not for the NOA account.

    Returns whether the user is authenticated or not.

    Return Value
    Returns True if user is authenticated, else False. deprecated api

    isPasswordRemembered ( )

    boolisPasswordRemembered()

    Returns true/false depending on whether the enabler remembers the user password or not.

    Returns whether the enabler remember the password.

    Return Value
    Returns True if password is remembered, else False.

    isServiceAllowed ( )

    intisServiceAllowed()

    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.

    Return Value
    int value of enum SSOAccountIdentityAllowed deprecated apiint value of enum SSOAccountIdentityAllowed

    lastLoggedInIdentifier ( )

    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

    Return Value
    lastLoginId.

    loginTimeStamp ( const QString & )

    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.
    Return Value
    Last logged in TimeStamp.Empty string incase last logged in timestamp doesnt exists.

    noAAccountId ( int )

    QString noAAccountId(inthashType)

    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

    oAuthTimeStamp ( )

    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.

    Return Value
    oAuthTimeStamp

    operatorId ( )

    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

    Return Value
    QString operator Id. deprecated apiQString operator Id.

    removeAccountDetails ( )

    ErrorCode removeAccountDetails()

    Deletes the cached account details, also the details from securestorage except for the username. User does not need to be logged in to use this method.

    Deletes the cached account details.

    Return Value
    error code if any error occurs in clearing the secure storage.

    removeCachedAccount ( )

    ErrorCode removeCachedAccount()

    Deletes the cached account details. User does not need to be logged in to use this method.

    Deletes the cached account details.

    Return Value
    error code if any error occurs in clearing the secure storage.

    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. errorNone if no error occured.
    requestTypeIndicates the Requested operation type.
    requestIdThe request id for which the signal is generated.

    serverUTCTime ( )

    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.

    Return Value
    server time in UTC

    signIn ( const QString &, const QString &, RememberMe )

    intsignIn(const QString &password = 0,
    const QString &userId = 0,
    RememberMerememberMe = 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
    passwordAccount password. If the password is not passed, then the enabler tries to use the cached password.
    userIdUser name for the account. If not passed cached user name will be used.
    rememberMeRemember Me Enum value to determine whether user credentials to be remembered for the session or not.
    Return Value
    A unique identifier for this request. -1, if NoA enabler encounters internal error, in this case enabler doesn't emit requestFinished signal.

    signOut ( )

    ErrorCode signOut()

    Signs the user out from the account. Deletes the associated token from cache.

    Signs the user out and notifies all clients.

    Return Value
    Error code if something goes wrong, errorNone if ok.

    termsAcceptance ( )

    TermsAcceptanceData termsAcceptance()

    Returns the retrieved terms acceptance data.

    Returns the terms acceptance info .

    Return Value
    Returns the additional contact information of the the account.

    timeSinceLastManualLogin ( )

    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 .

    token ( )

    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.

    Return Value
    Cached access token is returned as a QString.

    tokenStateChanged ( TokenState )

    voidtokenStateChanged(TokenStatetokenState)[signal]

    Notification to the client, about any change in the state of the access token e.g. if token has expired or been deleted.

    userId ( )

    QString userId()

    Returns the username value from the token creation response information Else returns empty Returns username of the account.

    Return Value
    username from the profile.

    userName ( )

    QString userName()

    Returns the username value from the token creation response information Else returns empty Returns cached username.

    Return Value
    username.