Sailfish Secrets
API DocumentationAuthenticationPlugin Class
(Sailfish::Secrets::AuthenticationPlugin)Specifies an interface allowing verification of a user's identity, retrieval of an authentication code or passphrase from a user, or both. More...
Header: | #include <Secrets/Plugins/extensionplugins.h> |
Inherits: | PluginBase and |
Public Types
enum | AuthenticationType { NoAuthentication, ApplicationSpecificAuthentication, SystemDefaultAuthentication, PinCodeAuthentication, ..., VoiceRecognitionAuthentication } |
flags | AuthenticationTypes |
Public Functions
AuthenticationPlugin(QObject *parent = Q_NULLPTR) | |
virtual | ~AuthenticationPlugin() |
virtual Sailfish::Secrets::AuthenticationPlugin::AuthenticationTypes | authenticationTypes() const = 0 |
virtual Sailfish::Secrets::Result | beginAuthentication(uint pid, qint64 requestId, const Sailfish::Secrets::InteractionParameters::PromptText &promptText) = 0 |
virtual Sailfish::Secrets::Result | beginUserInputInteraction(uint pid, qint64 requestId, const Sailfish::Secrets::InteractionParameters &interactionParameters, const QString &interactionServiceAddress) = 0 |
virtual void | cancelAuthentication(uint pid, qint64 requestId) = 0 |
virtual void | cancelUserInputInteraction(uint pid, qint64 requestId) = 0 |
virtual Sailfish::Secrets::InteractionParameters::InputTypes | inputTypes() const = 0 |
- 11 public functions inherited from Sailfish::Secrets::PluginBase
Signals
void | authenticationCompleted(uint callerPid, qint64 requestId, const Sailfish::Secrets::Result &result) |
void | userInputInteractionCompleted(uint callerPid, qint64 requestId, const Sailfish::Secrets::InteractionParameters &interactionParameters, const QString &interactionServiceAddress, const Sailfish::Secrets::Result &result, const QByteArray &userInput) |
Detailed Description
Specifies an interface allowing verification of a user's identity, retrieval of an authentication code or passphrase from a user, or both.
The AuthenticationPlugin type specifies an interface which includes operations to verify the identity of a user and to retrieve authentication codes from the user (from which encryption keys may be derived).
All methods provided by AuthenticationPlugin-derived types are invoked from the main thread of the secrets daemon, and thus care should be taken to avoid blocking.
Member Type Documentation
enum AuthenticationPlugin::AuthenticationType
flags AuthenticationPlugin::AuthenticationTypes
This enum defines the types of authentication offered by the plugin
Constant | Value | Description |
---|---|---|
Sailfish::Secrets::AuthenticationPlugin::NoAuthentication | 0 | No authentication, flows requiring authentication data will fail. |
Sailfish::Secrets::AuthenticationPlugin::ApplicationSpecificAuthentication | 1 | Unknown type, application generates auth code based on custom UI flow. |
Sailfish::Secrets::AuthenticationPlugin::SystemDefaultAuthentication | 2 | User enters some authentication data, as required by the system, to authenticate. |
Sailfish::Secrets::AuthenticationPlugin::PinCodeAuthentication | 4 | User enters a pin code as the authentication method |
Sailfish::Secrets::AuthenticationPlugin::PasswordAuthentication | 8 | User enters a password as the authentication method |
Sailfish::Secrets::AuthenticationPlugin::FingerprintAuthentication | 16 | User scans their fingerprint as the authentication method |
Sailfish::Secrets::AuthenticationPlugin::IrisScanAuthentication | 32 | User scans their iris as the authentication method |
Sailfish::Secrets::AuthenticationPlugin::VoiceRecognitionAuthentication | 64 | User performs voice recognition as the authentication method |
The AuthenticationTypes type is a typedef for QFlags<AuthenticationType>. It stores an OR combination of AuthenticationType values.
Member Function Documentation
AuthenticationPlugin::AuthenticationPlugin(QObject *parent = Q_NULLPTR)
Construct a new AuthenticationPlugin instance with the specified parent
[virtual]
AuthenticationPlugin::~AuthenticationPlugin()
Clean up the memory associated with the AuthenticationPlugin instance
[signal]
void AuthenticationPlugin::authenticationCompleted(uint callerPid, qint64 requestId, const Sailfish::Secrets::Result &result)
[pure virtual]
Sailfish::Secrets::AuthenticationPlugin::AuthenticationTypes AuthenticationPlugin::authenticationTypes() const
Return the types of authentication which are supported by this plugin
These are the ways in which the user's identity may be verificationStatus.
[pure virtual]
Sailfish::Secrets::Result AuthenticationPlugin::beginAuthentication(uint pid, qint64 requestId, const Sailfish::Secrets::InteractionParameters::PromptText &promptText)
Begin an authentication (user verification) flow on behalf of the application with the specified pid as part of the secrets framework request with the specified requestId.
This will be invoked if an application is attempting to perform some operation on a device-locked collection or secret, where the device lock key is known by the secrets daemon but the user must verify in order to allow the secrets daemon to unlock the collection or secret with the known device lock key.
When complete, the plugin should emit the authenticationCompleted() signal, with the result parameter having the appropriate result code set depending on whether the user successfully verificationStatus their identity or not.
If the plugin itself is locked, this function should return a Sailfish::Secrets::Result with the result code set to Sailfish::Secrets::Result::Failed and the error code set to Sailfish::Secrets::Result::SecretsPluginIsLockedError.
[pure virtual]
Sailfish::Secrets::Result AuthenticationPlugin::beginUserInputInteraction(uint pid, qint64 requestId, const Sailfish::Secrets::InteractionParameters &interactionParameters, const QString &interactionServiceAddress)
Begin a user input interaction flow on behalf of the application with the specified pid as part of the secrets framework request with the specified requestId, according to the specified interactionParameters, potentially using the in-app interaction service with the specified interactionServiceAddress.
If the plugin implements application-specific authentication (that is, allows the application to perform the user verification or user input flow in-process) then it should delegate the operation to the service whose (peer to peer) DBus address is given as interactionServiceAddress. Otherwise, the interactionServiceAddress parameter should be ignored.
The interactionParameters will contain a variety of parameters which specify the type of input which is wanted from the user, as well as the look and feel of any user interaction prompt which is required (e.g. the echo mode of input characters, etc).
When complete, the plugin should emit the userInputInteractionCompleted() signal, with the result parameter having an appropriate result code set and the user's input provided.
If the plugin itself is locked, this function should return a Sailfish::Secrets::Result with the result code set to Sailfish::Secrets::Result::Failed and the error code set to Sailfish::Secrets::Result::SecretsPluginIsLockedError.
[pure virtual]
void AuthenticationPlugin::cancelAuthentication(uint pid, qint64 requestId)
Cancel a running authentication flow.
This will cancel a running authentication flow.
[pure virtual]
void AuthenticationPlugin::cancelUserInputInteraction(uint pid, qint64 requestId)
Cancel a running user input interaction.
This will cancel a running user input interaction.
[pure virtual]
Sailfish::Secrets::InteractionParameters::InputTypes AuthenticationPlugin::inputTypes() const
Return the types of data which the plugin can return after retrieval from the user
These are the types of data which may be returned after user input interaction.