My Project
|
Represents a session to authentication plugin/server. More...
#include <SignOn/AuthSession>
Public Types | |
enum | AuthSessionError { UnknownError = 1 , InternalServerError = 2 , InternalCommunicationError = 3 , PermissionDeniedError = 4 , AuthSessionErr = 300 , MechanismNotAvailableError , MissingDataError , InvalidCredentialsError , WrongStateError , OperationNotSupportedError , NoConnectionError , NetworkError , SslError , RuntimeError , CanceledError , TimedOutError , UserInteractionError } |
Codes for errors that may be reported by AuthSession objects. More... | |
enum | AuthSessionState { SessionNotStarted = 0 , HostResolving , ServerConnecting , DataSending , ReplyWaiting , UserPending , UiRefreshing , ProcessPending , SessionStarted , ProcessCanceling , ProcessDone , CustomState , MaxState } |
Codes for the states of the AuthSession object. More... | |
Signals | |
void | error (const SignOn::Error &err) |
Emitted when an error occurs while performing an operation. More... | |
void | mechanismsAvailable (const QStringList &mechanisms) |
Emitted when the list of available mechanisms have been obtained for identity. More... | |
void | response (const SignOn::SessionData &sessionData) |
Authentication response generated by the authentication service. More... | |
void | stateChanged (AuthSession::AuthSessionState state, const QString &message) |
Provides the information about the state of the authentication request. More... | |
Public Member Functions | |
const QString | name () const |
Name of method for session. More... | |
void | queryAvailableMechanisms (const QStringList &wantedMechanisms=QStringList()) |
Query list of available mechanisms. More... | |
void | process (const SessionData &sessionData, const QString &mechanism=QString()) |
Processes sessionData in the authentication service. More... | |
void | challenge (const SessionData &sessionData, const QString &mechanism=QString()) |
Sends a challenge to the authentication service. More... | |
void | request (const SessionData &sessionData, const QString &mechanism=QString()) |
Sends a request to the authentication service. More... | |
void | cancel () |
Cancels the ongoing challenge. More... | |
void | signMessage (const SessionData ¶ms, const QString &mechanism=QString()) |
Signs message by using secret stored into identity. More... | |
Protected Member Functions | |
AuthSession (quint32 id, const QString &methodName, QObject *parent=0) | |
Represents a session to authentication plugin/server.
AuthSession is used to maintain connection to authentication plugin.
Definition at line 54 of file authsession.h.
Codes for errors that may be reported by AuthSession objects.
Replaced by Error::ErrorType.
Enumerator | |
---|---|
UnknownError | Catch-all for errors not distinguished by another code. |
InternalServerError | Signon Daemon internal error. |
InternalCommunicationError | Communication with Signon Daemon error . |
PermissionDeniedError | The operation cannot be performed due to insufficient client permissions. |
MechanismNotAvailableError | The requested mechanism is not available. |
MissingDataError | The SessionData object does not contain necessary information. |
InvalidCredentialsError | The supplied credentials are invalid for the mechanism implementation. |
WrongStateError | An operation method has been called in a wrong state. |
OperationNotSupportedError | The operation is not supported by the mechanism implementation. |
NoConnectionError | No Network connetion. |
NetworkError | Network connetion failed. |
SslError | Ssl connetion failed. |
RuntimeError | Casting SessionData into subclass failed |
CanceledError | Challenge was canceled. |
TimedOutError | Challenge was timed out. |
UserInteractionError | User interaction dialog failed |
Definition at line 69 of file authsession.h.
Codes for the states of the AuthSession object.
Definition at line 95 of file authsession.h.
|
protected |
Definition at line 35 of file authsession.cpp.
void SignOn::AuthSession::cancel | ( | ) |
Cancels the ongoing challenge.
Signal error() is emitted with Error::type() Error::SessionCanceled when process is canceled. If there is no challenge to cancel, Error::type() is Error::WrongState. If the operation fails, the error() signal is emitted.
Definition at line 76 of file authsession.cpp.
|
inline |
Sends a challenge to the authentication service.
The service processes the challenge and generates a response token that is emitted with response() signal. If the operation fails, the error() signal is emitted.
This is actually a call to process.
sessionData | Information for authentication session |
mechanism | Mechanism to use for authentication |
Definition at line 183 of file authsession.h.
|
signal |
Emitted when an error occurs while performing an operation.
Typical error types are generic errors, where Error::type() < Error::AuthServiceErr and AuthSession specific, where Error::AuthSessionErr < Error::type() < Error::UserErr
err | The error object |
|
signal |
Emitted when the list of available mechanisms have been obtained for identity.
mechanisms | List of available mechanisms |
const QString SignOn::AuthSession::name | ( | ) | const |
Name of method for session.
Definition at line 60 of file authsession.cpp.
void SignOn::AuthSession::process | ( | const SessionData & | sessionData, |
const QString & | mechanism = QString() |
||
) |
Processes sessionData in the authentication service.
The service processes the data and generates a response that is emitted with response() signal. If the operation fails, the error() signal is emitted.
The format and interpretation of the data is mechanism-specific. The client usually obtains the data from a network protocol, such as the protocols using SASL. In case the mechanism implies generation of the authentication token without a challenge, this method should be called with an empty parameters.
Parameters are key value pairs, and they are given for authentication plugin. For example it can contain server name, realm, client key, etc. If the Identity objected that created this AuthSession object was itself created using a IdentityInfo object having the username and secret set, that data is going to be added to the params map before it is passed to a specific authentication plugin implementation. If credentials have been stored with Identity::storeCredentials, then the username is overriden from database. Stored secret is used as a default value.
sessionData | Information for authentication session |
mechanism | Mechanism to use for authentication |
Definition at line 70 of file authsession.cpp.
void SignOn::AuthSession::queryAvailableMechanisms | ( | const QStringList & | wantedMechanisms = QStringList() | ) |
Query list of available mechanisms.
If wantedMechanisms list is provided, only mechanisms available on that list are reported. List is returned by emitting signal mechanismsAvailable(). If the operation fails, the error() signal is emitted.
wantedMechanisms | List of mechanisms that the client would like to use |
Definition at line 65 of file authsession.cpp.
|
inline |
Sends a request to the authentication service.
The service processes the request and generates a response token that is emitted with response() signal. If the operation fails, the error() signal is emitted.
This is actually a call to process.
sessionData | Information for authentication session |
mechanism | Mechanism to use for authentication |
Definition at line 201 of file authsession.h.
|
signal |
Authentication response generated by the authentication service.
It is sent after a process() call sends a challenge token for authentication is used to request an authentication token, with the response token and accompanying non-opaque information produced by the service.
The format and interpretation of the response, as well as names and types of the information parameters, are mechanism-specific.
sessionData | Parameters with the authentication token |
|
inline |
Signs message by using secret stored into identity.
This convenience interface is to do special challenge to signature service.
params | Extra information for signing |
mechanism | Mechanism to use for signing |
Definition at line 224 of file authsession.h.
|
signal |
Provides the information about the state of the authentication request.
state | Current state of the authentication request |
message | Textual description of the state |