Represents a session to authentication plugin/server. More...
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. |
|
void | mechanismsAvailable (const QStringList &mechanisms) |
Emitted when the list of available mechanisms have been obtained for identity. |
|
void | response (const SignOn::SessionData &sessionData) |
Authentication response generated by the authentication service. |
|
void | stateChanged (AuthSession::AuthSessionState state, const QString &message) |
Provides the information about the state of the authentication request. |
|
Public Member Functions |
|
const QString | name () const |
Name of method for session. |
|
void | queryAvailableMechanisms (const QStringList &wantedMechanisms=QStringList()) |
Query list of available mechanisms. |
|
void | process (const SessionData &sessionData, const QString &mechanism=QString()) |
Processes sessionData in the authentication service. |
|
void | challenge (const SessionData &sessionData, const QString &mechanism=QString()) |
Sends a challenge to the authentication service. |
|
void | request (const SessionData &sessionData, const QString &mechanism=QString()) |
Sends a request to the authentication service. |
|
void | cancel () |
Cancels the ongoing challenge. |
|
void | signMessage (const SessionData ¶ms, const QString &mechanism=QString()) |
Signs message by using secret stored into identity. |
|
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.
Codes for errors that may be reported by AuthSession objects.
Replaced by Error::ErrorType.
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 |
Codes for the states of the AuthSession object.
SignOn::AuthSession::AuthSession | ( | quint32 | id, | |
const QString & | methodName, | |||
QObject * | parent = 0 |
|||
) | [protected] |
For internal use only.
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.
void SignOn::AuthSession::challenge | ( | const SessionData & | sessionData, | |
const QString & | mechanism = QString() |
|||
) | [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 |
void SignOn::AuthSession::error | ( | const SignOn::Error & | err | ) | [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 |
void SignOn::AuthSession::mechanismsAvailable | ( | const QStringList & | mechanisms | ) | [signal] |
Emitted when the list of available mechanisms have been obtained for identity.
mechanisms | List of available mechanisms |
const QString SignOn::AuthSession::name | ( | ) | const |
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 |
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 |
void SignOn::AuthSession::request | ( | const SessionData & | sessionData, | |
const QString & | mechanism = QString() |
|||
) | [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 |
void SignOn::AuthSession::response | ( | const SignOn::SessionData & | sessionData | ) | [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 |
void SignOn::AuthSession::signMessage | ( | const SessionData & | params, | |
const QString & | mechanism = QString() |
|||
) | [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 |
void SignOn::AuthSession::stateChanged | ( | AuthSession::AuthSessionState | state, | |
const QString & | message | |||
) | [signal] |
Provides the information about the state of the authentication request.
state | Current state of the authentication request | |
message | Textual description of the state |
Copyright (C) 2009-2011 Nokia Corporation. LGPL |
MeeGo 1.2 Harmattan API
|