25 #include "identityimpl.h" 35 qRegisterMetaType<Error>(
"SignOn::Error");
36 qRegisterMetaType<Error>(
"Error");
38 if (qMetaTypeId<Error>() < QMetaType::User)
39 BLAME() <<
"Identity::Identity() - " 40 "SignOn::Error meta type not registered.";
42 impl =
new IdentityImpl(
this,
id);
48 identity->impl->copyInfo(
info);
70 impl->queryAvailableMethods();
75 if (methodName.isEmpty())
78 return AuthSessionP(impl->createSession(methodName,
this));
86 impl->destroySession(session.data());
91 impl->requestCredentialsUpdate(message);
96 impl->storeCredentials(
info);
106 impl->addReference(reference);
111 impl->removeReference(reference);
121 impl->verifyUser(message);
126 impl->verifyUser(params);
131 impl->verifySecret(secret);
quint32 id() const
Unique id of given identity.
void remove()
Removes this identity from database.
Identity(const quint32 id=SSO_NEW_IDENTITY, QObject *parent=0)
void verifyUser(const QString &message=QString())
Gets a secret verification from the user and compares it to the stored secret.
virtual ~Identity()
Destructor.
void destroySession(const AuthSessionP &session)
Destroys an authentication session.
void queryInfo()
Query stored credential parameters for this authentication identity.
void queryAvailableMethods()
Query list of available authentication methods for given identity.
void verifySecret(const QString &secret)
Verifies if the given secret match the stored secret.
void storeCredentials(const IdentityInfo &info=IdentityInfo())
Stores credential parameters for this authentication identity.
void requestCredentialsUpdate(const QString &message=QString())
Requests the user to give a new secret into database.
void signOut()
Signs out Identity from all services.
AuthSessionP createSession(const QString &methodName)
Creates a new session for authentication.
void addReference(const QString &reference=QString())
Adds the named reference to identity into the database.
Contains identity information.
void removeReference(const QString &reference=QString())
Removes a named reference to identity from the database.
static Identity * existingIdentity(const quint32 id, QObject *parent=0)
Constructs an identity object associated with an existing identity record.
void info(const SignOn::IdentityInfo &info)
Emitted when credentials passed by queryInfo() method.
Represents a database entry for a single identity.
static Identity * newIdentity(const IdentityInfo &info=IdentityInfo(), QObject *parent=0)
Constructs a new identity object.