24 #include <QDBusMetaType>
27 #include "identityimpl.h"
29 #include "securitycontext.h"
30 #include "securitycontextpriv.h"
39 qRegisterMetaType<Error>(
"SignOn::Error");
40 qRegisterMetaType<Error>(
"Error");
41 qDBusRegisterMetaType<SecurityContext>();
43 if (qMetaTypeId<Error>() < QMetaType::User)
44 BLAME() <<
"Identity::Identity() - "
45 "SignOn::Error meta type not registered.";
47 impl =
new IdentityImpl(
this,
id);
53 identity->impl->copyInfo(
info);
75 impl->queryAvailableMethods();
80 if (methodName.isEmpty())
83 return AuthSessionP(impl->createSession(methodName,
this));
91 impl->destroySession(session.data());
96 impl->requestCredentialsUpdate(message);
101 impl->storeCredentials(
info);
111 impl->addReference(reference);
116 impl->removeReference(reference);
126 impl->verifyUser(message);
131 impl->verifyUser(params);
136 impl->verifySecret(secret);
Contains identity information.
Represents a database entry for a single identity.
void destroySession(const AuthSessionP &session)
Destroys an authentication session.
static Identity * newIdentity(const IdentityInfo &info=IdentityInfo(), QObject *parent=0)
Constructs a new identity object.
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 requestCredentialsUpdate(const QString &message=QString())
Requests the user to give a new secret into database.
AuthSessionP createSession(const QString &methodName)
Creates a new session for authentication.
void verifySecret(const QString &secret)
Verifies if the given secret match the stored secret.
void verifyUser(const QString &message=QString())
Gets a secret verification from the user and compares it to the stored secret.
quint32 id() const
Unique id of given identity.
void info(const SignOn::IdentityInfo &info)
Emitted when credentials passed by queryInfo() method.
void signOut()
Signs out Identity from all services.
virtual ~Identity()
Destructor.
void remove()
Removes this identity from database.
void storeCredentials(const IdentityInfo &info=IdentityInfo())
Stores credential parameters for this authentication identity.
static Identity * existingIdentity(const quint32 id, QObject *parent=0)
Constructs an identity object associated with an existing identity record.
void queryAvailableMethods()
Query list of available authentication methods for given identity.
Identity(const quint32 id=SSO_NEW_IDENTITY, QObject *parent=0)