AuthPluginInterface Class
Interface definition for authentication plugins. More...
- Header:
#include <SignOn/AuthPluginInterface> - Inherits: QObject
List of all members, including inherited members
Public Functions
- AuthPluginInterface(QObject *parent = 0)
- ~AuthPluginInterface()
- void abort()
- void cancel()
- QStringList mechanisms() const
- void process(const SignOn::SessionData &inData, const QString &mechanism = QString())
- QString type() const
Public Slots
- void refresh(const SignOn::UiSessionData &data)
- void userActionFinished(const SignOn::UiSessionData &data)
Signals
- void error(const SignOn::Error &err)
- void refreshed(const SignOn::UiSessionData &data)
- void result(const SignOn::SessionData &data)
- void statusChanged(const AuthPluginState state, const QString &message = QString())
- void store(const SignOn::SessionData &data)
- void userActionRequired(const SignOn::UiSessionData &data)
Detailed Description
Member Function Documentation
AuthPluginInterface::AuthPluginInterface(QObject *parent = 0)
Creates the plugin with the given parent.
[virtual noexcept] AuthPluginInterface::~AuthPluginInterface()
Destructor
[virtual] void AuthPluginInterface::abort()
Requests to abort the process. Process is terminated after this call. Reimplement this in order to execute specific instructions before process is killed.
[virtual] void AuthPluginInterface::cancel()
Requests to cancel the process. Process is terminated after this call. Reimplement this in order to execute specific instructions before the effective cancel occurres.
[signal] void AuthPluginInterface::error(const SignOn::Error &err)
Emitted when authentication process has been completed for given data and resulting in the error err.
[pure virtual] QStringList AuthPluginInterface::mechanisms() const
Gets the list of supported mechanisms.
[pure virtual] void AuthPluginInterface::process(const SignOn::SessionData &inData, const QString &mechanism = QString())
Process authentication with the input data inData, using the authentication mechanism. Authentication can be logging to a server, obtain token(s) from a server, calculate response using given challenge, etc. Given session data is used to do authentication and return response. Signal result() is emitted when authentication is completed, or signal error() if authentication failed.
[virtual slot] void AuthPluginInterface::refresh(const SignOn::UiSessionData &data)
Refreshes the ui session data. Signond uses this slot to refresh data in given ui session. Mostly used to refresh a captcha images during the user interaction. Signal refreshed() or error() must be emitted when refresh is completed. This must be reimplemented to refresh the captcha image.
Note: Emitting signal userActionRequired() is not allowed before ui session is finished.
See also SignOn::UiSessionData, refreshed()
[signal] void AuthPluginInterface::refreshed(const SignOn::UiSessionData &data)
Emitted when authentication process has completed refresh request, with the refreshed ui session data. Plugin must emit signal refreshed() to response to refresh() call.
See also refresh()
[signal] void AuthPluginInterface::result(const SignOn::SessionData &data)
Emitted when authentication process has been completed for given data and there are no errors; data is the resulting SessionData, which needs to be returned to the client.
[signal] void AuthPluginInterface::statusChanged(const AuthPluginState state, const QString &message = QString())
* Emitted to report status of authentication process to signond for * informing client application: the plugin process state, and an * optional message for the client application. * *
See also AuthPluginState
[signal] void AuthPluginInterface::store(const SignOn::SessionData &data)
Emitted when authentication process want to store session data parameters data for later use. Stored parameters are added into SessionData in following process calls. This is useful when authentication is using permanent tokens.
Note: This is shared within same identity using same method only. There can be storage size limitation for data that can be stored.
[pure virtual] QString AuthPluginInterface::type() const
Gets the type of the plugin
[virtual slot] void AuthPluginInterface::userActionFinished(const SignOn::UiSessionData &data)
User interaction completed, with the ui session data the user completed. Signond uses this slot to notice the end of ui session. This is a response to userActionRequired() signal. This must be reimplemented to get the response from the user interaction.
See also SignOn::UiSessionData, userActionRequired()
[signal] void AuthPluginInterface::userActionRequired(const SignOn::UiSessionData &data)
Emitted when authentication process need to interact with user; data is the ui session data to be filled within user interaction. Basic use cases are: query password, verify captcha, show url. Can also be used to get username/password for proxy authentication etc. Slot userActionFinished() is called when interaction is completed.
Note: Slot userActionFinished() should be reimplemented to get result.
See also userActionFinished(), SignOn::UiSessionData
Related Non-Members
enum AuthPluginState
Predefined states to be used for progress reporting.
| Constant | Value | Description |
|---|---|---|
AuthPluginInterface::PLUGIN_STATE_NONE |
0 |
State unknown. |
AuthPluginInterface::PLUGIN_STATE_RESOLVING |
1 |
Resolving remote server host name. |
AuthPluginInterface::PLUGIN_STATE_CONNECTING |
2 |
Connecting to remote server. |
AuthPluginInterface::PLUGIN_STATE_SENDING |
3 |
Sending data to remote server. |
AuthPluginInterface::PLUGIN_STATE_WAITING |
4 |
Waiting for reply from remote server. |
AuthPluginInterface::PLUGIN_STATE_PENDING |
5 |
Waiting for response from user. |
AuthPluginInterface::PLUGIN_STATE_REFRESHING |
6 |
Refreshing ui request. |
AuthPluginInterface::PLUGIN_STATE_CANCELING |
7 |
Canceling current process. |
AuthPluginInterface::PLUGIN_STATE_HOLDING |
8 |
Holding long non-expired token. Process should be kept alive. |
AuthPluginInterface::PLUGIN_STATE_DONE |
9 |
Process is finished. Process can be terminated. |
Macro Documentation
SIGNON_DECL_AUTH_PLUGIN(pluginclass)
Declares pluginclass as the plugin's AuthPluginInterface: defines the exported auth_plugin_instance() function signond looks for.
SIGNON_PLUGIN_INSTANCE(pluginclass)
Macro to create declarations of SSO authentication plugin: the body of a function that returns the single instance of pluginclass.