MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9

Represents a database entry for a single identity. More...

Inheritance diagram for SignOn::Identity:
Inheritance graph
[legend]

List of all members.

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 &params)
  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)

Detailed Description

Represents a database entry for a single identity.

Identity is a client side presentation of a credential.


Member Enumeration Documentation

Codes for errors that may be reported by Identity objects.

Deprecated:
This enum is deprecated.

Replaced by Error::ErrorType.

Enumerator:
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


Constructor & Destructor Documentation

SignOn::Identity::Identity ( const quint32  id = SSO_NEW_IDENTITY,
QObject parent = 0  
) [protected]

For internal use only.


Member Function Documentation

void SignOn::Identity::addReference ( const QString reference = QString()  ) 

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.

See also:
referenceAdded()
Identity::error()
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.

Parameters:
methodName  Name of authentication method to use
Returns:
New authentication session or NULL if not able to create
void SignOn::Identity::credentialsStored ( const quint32  id  )  [signal]

Emitted when credentials passed by storeCredentials() method have been successfully stored on the service.

Parameters:
id  Identifier of the credentials that has been stored
void SignOn::Identity::destroySession ( const AuthSessionP session  ) 

Destroys an authentication session.

Parameters:
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

See also:
SignOn::Error.
SignOn::Error::ErrorType
Parameters:
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.

Parameters:
id  Identity ID on the service
parent  Parent object of the identity
Returns:
Pointer to identity object or NULL if it fails to create.
quint32 SignOn::Identity::id (  )  const

Unique id of given identity.

Returns:
Identity ID of the identity. For new identity which is not stored, NEW_IDENTITY is returned.
void SignOn::Identity::info ( const SignOn::IdentityInfo info  )  [signal]

Emitted when credentials passed by queryInfo() method.

Parameters:
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.

Parameters:
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.

Parameters:
info  Identity information
parent  Parent object of the identity
Returns:
Pointer to new identity object or NULL if it fails to create.
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.

See also:
Identity::error() If identity is not stored, Error::type() is Error::CredentialsNotAvailable, or Error::IdentityNotFound.
methodsAvailable().
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.

See also:
info()
Identity::error()
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.

See also:
removed()
Identity::error()
void SignOn::Identity::removeReference ( const QString reference = QString()  ) 

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.

See also:
referenceRemoved()
Identity::error()
void SignOn::Identity::requestCredentialsUpdate ( const QString message = QString()  ) 

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.

See also:
credentialsStored()
Identity::error()
Parameters:
message  Message to be shown for the user
void SignOn::Identity::secretVerified ( const bool  valid  )  [signal]

Emitted when secret verification is completed.

Parameters:
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.

See also:
signedOut()
Identity::error()
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.

See also:
IdentityInfo 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,

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()

See also:
credentialsStored()
Identity::error()
Parameters:
info  Credentials to store
void SignOn::Identity::userVerified ( const bool  valid  )  [signal]

Emitted when the user verification is completed.

Parameters:
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.

See also:
secretVerified()
Identity::error()
Parameters:
secret  String to be verified
void SignOn::Identity::verifyUser ( const QString message = QString()  ) 

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.

See also:
userVerified()
Identity::error()
Parameters:
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.

See also:
userVerified()
Identity::error()
Parameters:
params  Dialog customization parameters

Copyright (C) 2009-2011 Nokia Corporation.
LGPL
MeeGo 1.2 Harmattan API