Represents a database entry for a single identity. More...
Public Types |
|
enum | IdentityError { UnknownError = 1, InternalServerError = 2, InternalCommunicationError = 3, PermissionDeniedError = 4, IdentityErr = 200, MethodNotAvailableError, NotFoundError, StoreFailedError, RemoveFailedError, SignOutFailedError, CanceledError, CredentialsNotAvailableError } |
Codes for errors that may be reported by Identity objects. More... |
|
Signals |
|
void | error (const SignOn::Error &err) |
Emitted when an error occurs while performing an operation. |
|
void | methodsAvailable (const QStringList &methods) |
Emitted when the list of available mechanisms has been obtained for identity. |
|
void | credentialsStored (const quint32 id) |
Emitted when credentials passed by storeCredentials() method have been successfully stored on the service. |
|
void | referenceAdded () |
Emitted when references are added by addReference() method and change has been successfully stored on the service. |
|
void | referenceRemoved () |
Emitted when references are removed by removeReference() method and change has been successfully stored on the service. |
|
void | info (const SignOn::IdentityInfo &info) |
Emitted when credentials passed by queryInfo() method. |
|
void | userVerified (const bool valid) |
Emitted when the user verification is completed. |
|
void | secretVerified (const bool valid) |
Emitted when secret verification is completed. |
|
void | signedOut () |
Emitted when the identity is signed out. |
|
void | removed () |
Emitted when the identity is removed. |
|
Public Member Functions |
|
virtual | ~Identity () |
Destructor. |
|
quint32 | id () const |
Unique id of given identity. |
|
void | queryAvailableMethods () |
Query list of available authentication methods for given identity. |
|
AuthSessionP | createSession (const QString &methodName) |
Creates a new session for authentication. |
|
void | destroySession (const AuthSessionP &session) |
Destroys an authentication session. |
|
void | requestCredentialsUpdate (const QString &message=QString()) |
Requests the user to give a new secret into database. |
|
void | storeCredentials (const IdentityInfo &info=IdentityInfo()) |
Stores credential parameters for this authentication identity. |
|
void | remove () |
Removes this identity from database. |
|
void | addReference (const QString &reference=QString()) |
Adds the named reference to identity into the database. |
|
void | removeReference (const QString &reference=QString()) |
Removes a named reference to identity from the database. |
|
void | queryInfo () |
Query stored credential parameters for this authentication identity. |
|
void | verifyUser (const QString &message=QString()) |
Gets a secret verification from the user and compares it to the stored secret. |
|
void | verifyUser (const QVariantMap ¶ms) |
Gets a secret verification from the user and compares it to the stored secret. |
|
void | verifySecret (const QString &secret) |
Verifies if the given secret match the stored secret. |
|
void | signOut () |
Signs out Identity from all services. |
|
Static Public Member Functions |
|
static Identity * | newIdentity (const IdentityInfo &info=IdentityInfo(), QObject *parent=0) |
Constructs a new identity object. |
|
static Identity * | existingIdentity (const quint32 id, QObject *parent=0) |
Constructs an identity object associated with an existing identity record. |
|
Protected Member Functions |
|
Identity (const quint32 id=SSO_NEW_IDENTITY, QObject *parent=0) |
Represents a database entry for a single identity.
Identity is a client side presentation of a credential.
Codes for errors that may be reported by Identity objects.
Replaced by Error::ErrorType.
UnknownError |
Catch-all for errors not distinguished by another code. |
InternalServerError |
Signon Daemon internal error. |
InternalCommunicationError |
Communication with Signon Daemon error . |
PermissionDeniedError |
The operation cannot be performed due to insufficient client permissions. |
MethodNotAvailableError |
The requested mechanism is not available. |
NotFoundError |
The identity matching this Identity object was not found on the service. |
StoreFailedError |
Storing credentials failed. |
RemoveFailedError |
Removing credentials failed. |
SignOutFailedError |
SignOut failed. |
CanceledError |
Operation was canceled by user. |
CredentialsNotAvailableError |
Query fails |
SignOn::Identity::Identity | ( | const quint32 | id = SSO_NEW_IDENTITY , |
|
QObject * | parent = 0 |
|||
) | [protected] |
For internal use only.
Adds the named reference to identity into the database.
On success, a signal referenceAdded() is emitted If the operation fails, a signal error() is emitted. If referencing fails, Error::type() is Error::StoreFailed,
Untrusted clients may be blocked from performing this operation, subject to the security framework restrictions.
AuthSessionP SignOn::Identity::createSession | ( | const QString & | methodName | ) |
Creates a new session for authentication.
This creates a connection to authentication plugin. The Identity object is parent and owner of all created authentication sessions.
methodName | Name of authentication method to use |
void SignOn::Identity::credentialsStored | ( | const quint32 | id | ) | [signal] |
Emitted when credentials passed by storeCredentials() method have been successfully stored on the service.
id | Identifier of the credentials that has been stored |
void SignOn::Identity::destroySession | ( | const AuthSessionP & | session | ) |
Destroys an authentication session.
session | Session to be destroyed |
void SignOn::Identity::error | ( | const SignOn::Error & | err | ) | [signal] |
Emitted when an error occurs while performing an operation.
Typical error types are generic errors, where Error::type() < Error::AuthServiceErr and Identity specific, where Error::IdentityErr < Error::type() < Error::AuthServiceErr
err | The error object. |
static Identity* SignOn::Identity::existingIdentity | ( | const quint32 | id, | |
QObject * | parent = 0 |
|||
) | [static] |
Constructs an identity object associated with an existing identity record.
Can return NULL if client is untrusted.
id | Identity ID on the service | |
parent | Parent object of the identity |
quint32 SignOn::Identity::id | ( | ) | const |
Unique id of given identity.
void SignOn::Identity::info | ( | const SignOn::IdentityInfo & | info | ) | [signal] |
Emitted when credentials passed by queryInfo() method.
info | Credentials as have been stored on the service |
void SignOn::Identity::methodsAvailable | ( | const QStringList & | methods | ) | [signal] |
Emitted when the list of available mechanisms has been obtained for identity.
methods | List of available methods |
static Identity* SignOn::Identity::newIdentity | ( | const IdentityInfo & | info = IdentityInfo() , |
|
QObject * | parent = 0 |
|||
) | [static] |
Constructs a new identity object.
Can return NULL if client is untrusted.
info | Identity information | |
parent | Parent object of the identity |
void SignOn::Identity::queryAvailableMethods | ( | ) |
Query list of available authentication methods for given identity.
List is returned by emitting signal methodsAvailable(). If the operation fails, a signal error() is emitted.
void SignOn::Identity::queryInfo | ( | ) |
Query stored credential parameters for this authentication identity.
On success, a signal info() is emitted with parameters in the service. If the operation fails, a signal error() is emitted. If query fails, Error::type() is Error::CredentialsNotAvailable,
Untrusted clients may be blocked from performing this operation, subject to the security framework restrictions.
void SignOn::Identity::remove | ( | ) |
Removes this identity from database.
On success, a signal removed() is emitted If the operation fails, a signal error() is emitted. If removing fails, Error::type() is Error::RemoveFailed,
Untrusted clients may be blocked from performing this operation, subject to the security framework restrictions.
Removes a named reference to identity from the database.
On success, a signal referenceRemoved() is emitted If the operation fails, a signal error() is emitted. If dereferencing fails, Error::type() is Error::ReferenceNotFound,
Untrusted clients may be blocked from performing this operation, subject to the security framework restrictions.
Requests the user to give a new secret into database.
Client can use requestCredentialsUpdate() to launch external dialog for asking new secret, that will be stored into database. On success, a signal credentialsStored() is emitted. If the operation fails, a signal error() is emitted. If storing changes fails, Error::type() is Error::StoreFailed, If user cancels dialog, Error::type() is Error::IdentityOperationCanceled.
message | Message to be shown for the user |
void SignOn::Identity::secretVerified | ( | const bool | valid | ) | [signal] |
Emitted when secret verification is completed.
valid | Is the given secret same as stored |
void SignOn::Identity::signOut | ( | ) |
Signs out Identity from all services.
All authentication sessions using this Identity will be invalidated and all tokens cleared from cache. When sign out is completed, signal signedOut() is emitted. If the operation fails, a signal error() is emitted. If signout fails, Error::type() is Error::SignOutFailed.
All clients using same identity will receive signedOut signal.
void SignOn::Identity::storeCredentials | ( | const IdentityInfo & | info = IdentityInfo() |
) |
Stores credential parameters for this authentication identity.
IdentityInfo contains restrictions on methods and mechanisms for given Identity.
Untrusted clients may be blocked from performing this operation, subject to the security framework restrictions.
If default value is used for the parameter the Identity object stores the internally stored information, e.g. the IdentityInfo object used to create a new identity using Identity::newIdentity()
info | Credentials to store |
void SignOn::Identity::userVerified | ( | const bool | valid | ) | [signal] |
Emitted when the user verification is completed.
valid | Is the given secret same as stored |
void SignOn::Identity::verifySecret | ( | const QString & | secret | ) |
Verifies if the given secret match the stored secret.
When verification is completed, a signal secretVerified() is emitted. If the operation fails, a signal error() is emitted. If the credentials are not stored, Error::type() is Error::CredentialsNotAvailable.
secret | String to be verified |
Gets a secret verification from the user and compares it to the stored secret.
This launchs an external dialog for asking secret. When verification is completed, signal userVerified() is emitted. If the operation fails, a signal error() is emitted. If user selects "Forgot Password"-sequence, Error::type() is Error::ForgotPassword.
message | Message to be shown for the user |
void SignOn::Identity::verifyUser | ( | const QVariantMap & | params | ) |
Gets a secret verification from the user and compares it to the stored secret.
This launchs an external dialog for asking secret. When verification is completed, signal userVerified() is emitted. If the operation fails, a signal error() is emitted. If user selects "Forgot Password"-sequence, Error::type() is Error::ForgotPassword.
params | Dialog customization parameters |
Copyright (C) 2009-2011 Nokia Corporation. LGPL |
MeeGo 1.2 Harmattan API
|