KIMAP::LoginJob Class
The LoginJob class. More...
| Header: | #include <KIMAP/LoginJob> |
| CMake: | find_package(KPim6IMAP REQUIRED)target_link_libraries(mytarget PRIVATE KPim6::IMAP) |
| Inherits: | KIMAP::Job |
Public Types
| enum | AuthenticationMode { ClearText, Login, Plain, CramMD5, DigestMD5, …, XOAuth2 } |
| enum | EncryptionMode { Unencrypted, SSLorTLS, STARTTLS } |
| enum | ErrorCode { ERR_COULD_NOT_CONNECT } |
Public Functions
| LoginJob(KIMAP::Session *session) | |
| QString | authorizationName() const |
| KIMAP::LoginJob::EncryptionMode | encryptionMode() |
| QString | password() const |
| QString | serverGreeting() const |
| void | setAuthenticationMode(KIMAP::LoginJob::AuthenticationMode mode) |
| void | setAuthorizationName(const QString &authorizationName) |
| void | setEncryptionMode(KIMAP::LoginJob::EncryptionMode mode) |
| void | setPassword(const QString &password) |
| void | setUserName(const QString &userName) |
| QString | userName() const |
Detailed Description
Member Type Documentation
enum LoginJob::AuthenticationMode
| Constant | Value |
|---|---|
KIMAP::LoginJob::ClearText | 0 |
KIMAP::LoginJob::Login | 1 |
KIMAP::LoginJob::Plain | 2 |
KIMAP::LoginJob::CramMD5 | 3 |
KIMAP::LoginJob::DigestMD5 | 4 |
KIMAP::LoginJob::NTLM | 5 |
KIMAP::LoginJob::GSSAPI | 6 |
KIMAP::LoginJob::Anonymous | 7 |
KIMAP::LoginJob::XOAuth2 | 8 |
enum LoginJob::EncryptionMode
*
| Constant | Value | Description |
|---|---|---|
KIMAP::LoginJob::Unencrypted | 0 | * |
KIMAP::LoginJob::SSLorTLS | 1 | Use SSL/TLS encryption, KIMAP will automatically negotiate the best supported encryption protocol. * |
KIMAP::LoginJob::STARTTLS | 2 | Use STARTTLS to upgrade an initially plaintext connection to e ncrypted connection. KIMAP will automatically negotiate the best supported encryption protocol. |
enum LoginJob::ErrorCode
| Constant | Value |
|---|---|
KIMAP::LoginJob::ERR_COULD_NOT_CONNECT | KJob::UserDefinedError + 23 |
Member Function Documentation
[explicit] LoginJob::LoginJob(KIMAP::Session *session)
QString LoginJob::authorizationName() const
Get the authorization identity.
See also setAuthorizationName().
KIMAP::LoginJob::EncryptionMode LoginJob::encryptionMode()
Returns the currently active encryption mode
See also setEncryptionMode().
QString LoginJob::password() const
See also setPassword().
QString LoginJob::serverGreeting() const
Returns the server greeting, in case of a successful login.
If the login wasn't successful, this method returns an empty string. Use errorString() to get the error message in this case.
Note that the content of this response is not defined by the IMAP protocol and is implementation-dependent.
void LoginJob::setAuthenticationMode(KIMAP::LoginJob::AuthenticationMode mode)
void LoginJob::setAuthorizationName(const QString &authorizationName)
Set the authorization identity.
If set, proxy-authentication according to RFC4616 will be used.
Note that this feature only works with the "PLAIN" AuthenticationMode.
The authorizationName will be used together with the password() to get authenticated as userName() by the authorization of the provided credentials. This allows to login as a user using the admin credentials and the users name.
See also authorizationName().
void LoginJob::setEncryptionMode(KIMAP::LoginJob::EncryptionMode mode)
Set the encryption mode for the connection.
In case an encryption mode is set, the caller MUST check the encryptionMode() result after executing the job, to see if the connection is encrypted or not (e.g handshaking failed).
mode the encryption mode, see EncryptionModes
See also encryptionMode().
void LoginJob::setPassword(const QString &password)
See also password().
void LoginJob::setUserName(const QString &userName)
See also userName().
QString LoginJob::userName() const
See also setUserName().