SignOn::Identity Class
Represents a database entry for a single identity. More...
- Header:
#include <SignOn/Identity> - CMake:
find_package(SignOnQt6 REQUIRED)
target_link_libraries(mytarget PRIVATE SignOnQt6::SignOnQt6) - Inherits: QObject
List of all members, including inherited members
Deprecated members
Public Functions
- ~Identity()
- void addReference(const QString &reference = QString())
- SignOn::AuthSessionP createSession(const QString &methodName)
- void destroySession(const SignOn::AuthSessionP &session)
- quint32 id() const
- void queryAvailableMethods()
- void queryInfo()
- void remove()
- void removeReference(const QString &reference = QString())
- void requestCredentialsUpdate(const QString &message = QString())
- void signOut()
- void storeCredentials(const SignOn::IdentityInfo &info = IdentityInfo())
- void verifySecret(const QString &secret)
- void verifyUser(const QString &message = QString())
- void verifyUser(const QVariantMap ¶ms)
Signals
- void credentialsStored(const quint32 id)
- void error(const SignOn::Error &err)
- void info(const SignOn::IdentityInfo &info)
- void methodsAvailable(const QStringList &methods)
- void referenceAdded()
- void referenceRemoved()
- void removed()
- void secretVerified(const bool valid)
- void signedOut()
- void userVerified(const bool valid)
Static Public Members
- SignOn::Identity *existingIdentity(const quint32 id, QObject *parent = 0)
- SignOn::Identity *newIdentity(const SignOn::IdentityInfo &info = IdentityInfo(), QObject *parent = 0)
Detailed Description
Identity is a client side presentation of a credential.
Member Function Documentation
[virtual noexcept] Identity::~Identity()
Destructor
void 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(), error()
SignOn::AuthSessionP Identity::createSession(const QString &methodName)
Creates a new session for authentication with the authentication method methodName. This creates a connection to authentication plugin. The Identity object is parent and owner of all created authentication sessions.
Returns the new authentication session, or NULL if not able to create it.
[signal] void Identity::credentialsStored(const quint32 id)
Emitted when credentials passed by storeCredentials() method have been successfully stored on the service; id identifies the stored credentials.
void Identity::destroySession(const SignOn::AuthSessionP &session)
Destroys the authentication session.
[signal] void Identity::error(const SignOn::Error &err)
Emitted when an error occurs while performing an operation; err is the error. 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
[static] SignOn::Identity *Identity::existingIdentity(const quint32 id, QObject *parent = 0)
Constructs an identity object associated with the existing identity record id on the service, with the given parent.
Returns a pointer to the identity object, or NULL if it fails to create it: it can return NULL if the client is untrusted.
quint32 Identity::id() const
Returns the unique ID of the identity. For a new identity which is not stored, NEW_IDENTITY is returned.
[signal] void Identity::info(const SignOn::IdentityInfo &info)
Emitted with the credentials info stored on the service, in reply to queryInfo().
[signal] void Identity::methodsAvailable(const QStringList &methods)
Emitted when the list of available methods has been obtained for identity.
[static] SignOn::Identity *Identity::newIdentity(const SignOn::IdentityInfo &info = IdentityInfo(), QObject *parent = 0)
Constructs a new identity object with the identity information info and the given parent.
Returns a pointer to the new identity object, or NULL if it fails to create it: it can return NULL if the client is untrusted.
void 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. If identity is not stored, Error::type() is Error::CredentialsNotAvailable, or Error::IdentityNotFound.
See also methodsAvailable(), error()
void 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.
[signal] void Identity::referenceAdded()
Emitted when references are added by addReference() method and change has been successfully stored on the service.
[signal] void Identity::referenceRemoved()
Emitted when references are removed by removeReference() method and change has been successfully stored on the service.
void 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.
void Identity::removeReference(const QString &reference = QString())
Removes the 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(), error()
[signal] void Identity::removed()
Emitted when the identity is removed.
void Identity::requestCredentialsUpdate(const QString &message = QString())
Requests the user to give a new secret into database, showing message to the user. 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(), error()
[signal] void Identity::secretVerified(const bool valid)
Emitted when secret verification is completed; valid tells whether the given secret is the same as the stored one.
void 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. * *
[signal] void Identity::signedOut()
Emitted when the identity is signed out.
void Identity::storeCredentials(const SignOn::IdentityInfo &info = IdentityInfo())
Stores the credentials info for this authentication identity. IdentityInfo contains restrictions on methods and mechanisms for given Identity. 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(), error(), IdentityInfo
[signal] void Identity::userVerified(const bool valid)
Emitted when the user verification is completed; valid tells whether the given secret is the same as the stored one.
void Identity::verifySecret(const QString &secret)
Verifies if secret matches 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(), error()
void Identity::verifyUser(const QString &message = QString())
Gets a secret verification from the user and compares it to the stored secret, showing message to the user. This launches 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(), error()
void Identity::verifyUser(const QVariantMap ¶ms)
Gets a secret verification from the user and compares it to the stored secret, with the dialog customization parameters params. This launches 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.
This is an overloaded function.
See also userVerified(), error()
Related Non-Members
AuthSessionP
A guarded pointer to an AuthSession.