|
| UserStore (QString host, QString authenticationToken=QString(), QObject *parent=0) |
|
void | setAuthenticationToken (QString authenticationToken) |
|
QString | authenticationToken () |
|
bool | checkVersion (QString clientName, qint16 edamVersionMajor=EDAM_VERSION_MAJOR, qint16 edamVersionMinor=EDAM_VERSION_MINOR) |
|
AsyncResult * | checkVersionAsync (QString clientName, qint16 edamVersionMajor=EDAM_VERSION_MAJOR, qint16 edamVersionMinor=EDAM_VERSION_MINOR) |
|
BootstrapInfo | getBootstrapInfo (QString locale) |
|
AsyncResult * | getBootstrapInfoAsync (QString locale) |
|
AuthenticationResult | authenticate (QString username, QString password, QString consumerKey, QString consumerSecret, bool supportsTwoFactor) |
|
AsyncResult * | authenticateAsync (QString username, QString password, QString consumerKey, QString consumerSecret, bool supportsTwoFactor) |
|
AuthenticationResult | authenticateLongSession (QString username, QString password, QString consumerKey, QString consumerSecret, QString deviceIdentifier, QString deviceDescription, bool supportsTwoFactor) |
|
AsyncResult * | authenticateLongSessionAsync (QString username, QString password, QString consumerKey, QString consumerSecret, QString deviceIdentifier, QString deviceDescription, bool supportsTwoFactor) |
|
AuthenticationResult | completeTwoFactorAuthentication (QString oneTimeCode, QString deviceIdentifier, QString deviceDescription, QString authenticationToken=QString()) |
|
AsyncResult * | completeTwoFactorAuthenticationAsync (QString oneTimeCode, QString deviceIdentifier, QString deviceDescription, QString authenticationToken=QString()) |
|
void | revokeLongSession (QString authenticationToken=QString()) |
|
AsyncResult * | revokeLongSessionAsync (QString authenticationToken=QString()) |
|
AuthenticationResult | authenticateToBusiness (QString authenticationToken=QString()) |
|
AsyncResult * | authenticateToBusinessAsync (QString authenticationToken=QString()) |
|
AuthenticationResult | refreshAuthentication (QString authenticationToken=QString()) |
|
AsyncResult * | refreshAuthenticationAsync (QString authenticationToken=QString()) |
|
User | getUser (QString authenticationToken=QString()) |
|
AsyncResult * | getUserAsync (QString authenticationToken=QString()) |
|
PublicUserInfo | getPublicUserInfo (QString username) |
|
AsyncResult * | getPublicUserInfoAsync (QString username) |
|
PremiumInfo | getPremiumInfo (QString authenticationToken=QString()) |
|
AsyncResult * | getPremiumInfoAsync (QString authenticationToken=QString()) |
|
QString | getNoteStoreUrl (QString authenticationToken=QString()) |
|
AsyncResult * | getNoteStoreUrlAsync (QString authenticationToken=QString()) |
|
Service: UserStore
The UserStore service is primarily used by EDAM clients to establish authentication via username and password over a trusted connection (e.g. SSL). A client's first call to this interface should be checkVersion() to ensure that the client's software is up to date.
All calls which require an authenticationToken may throw an EDAMUserException for the following reasons:
-
AUTH_EXPIRED "authenticationToken" - token has expired
-
BAD_DATA_FORMAT "authenticationToken" - token is malformed
-
DATA_REQUIRED "authenticationToken" - token is empty
-
INVALID_AUTH "authenticationToken" - token signature is invalid
AuthenticationResult qevercloud::UserStore::authenticate |
( |
QString |
username, |
|
|
QString |
password, |
|
|
QString |
consumerKey, |
|
|
QString |
consumerSecret, |
|
|
bool |
supportsTwoFactor |
|
) |
| |
This is used to check a username and password in order to create a short-lived authentication session that can be used for further actions.
This function is only available to Evernote's internal applications. Third party applications must authenticate using OAuth as described at dev.evernote.com.
- Parameters
-
username | The username (not numeric user ID) for the account to authenticate against. This function will also accept the user's registered email address in this parameter. |
password | The plaintext password to check against the account. Since this is not protected by the EDAM protocol, this information must be provided over a protected transport (e.g. SSL). |
consumerKey | The "consumer key" portion of the API key issued to the client application by Evernote. |
consumerSecret | The "consumer secret" portion of the API key issued to the client application by Evernote. |
supportsTwoFactor | Whether the calling application supports two-factor authentication. If this parameter is false, this method will fail with the error code INVALID_AUTH and the parameter "password" when called for a user who has enabled two-factor authentication. |
- Returns
The result of the authentication. If the authentication was successful, the AuthenticationResult.user field will be set with the full information about the User.
If the user has two-factor authentication enabled, AuthenticationResult.secondFactorRequired will be set and AuthenticationResult.authenticationToken will contain a short-lived token that may only be used to complete the two-factor authentication process by calling UserStore.completeTwoFactorAuthentication.
- Exceptions
-
EDAMUserException |
-
DATA_REQUIRED "username" - username is empty
-
DATA_REQUIRED "password" - password is empty
-
DATA_REQUIRED "consumerKey" - consumerKey is empty
-
INVALID_AUTH "username" - username not found
-
INVALID_AUTH "password" - password did not match
-
INVALID_AUTH "consumerKey" - consumerKey is not authorized
-
INVALID_AUTH "consumerSecret" - consumerSecret is incorrect
-
PERMISSION_DENIED "User.active" - user account is closed
-
PERMISSION_DENIED "User.tooManyFailuresTryAgainLater" - user has failed authentication too often
|
AuthenticationResult qevercloud::UserStore::authenticateLongSession |
( |
QString |
username, |
|
|
QString |
password, |
|
|
QString |
consumerKey, |
|
|
QString |
consumerSecret, |
|
|
QString |
deviceIdentifier, |
|
|
QString |
deviceDescription, |
|
|
bool |
supportsTwoFactor |
|
) |
| |
This is used to check a username and password in order to create a long-lived authentication token that can be used for further actions.
This function is not available to most third party applications, which typically authenticate using OAuth as described at dev.evernote.com. If you believe that your application requires permission to authenticate using username and password instead of OAuth, please contact Evernote developer support by visiting dev.evernote.com.
- Parameters
-
username | The username or registered email address of the account to authenticate against. |
password | The plaintext password to check against the account. Since this is not protected by the EDAM protocol, this information must be provided over a protected transport (i.e. SSL). |
consumerKey | The "consumer key" portion of the API key issued to the client application by Evernote. |
consumerSecret | The "consumer secret" portion of the API key issued to the client application by Evernote. |
deviceIdentifier | An optional string, no more than 32 characters in length, that uniquely identifies the device from which the authentication is being performed. This string allows the service to return the same authentication token when a given application requests authentication repeatedly from the same device. This may happen when the user logs out of an application and then logs back in, or when the application is uninstalled and later reinstalled. If no reliable device identifier can be created, this value should be omitted. If set, the device identifier must be between 1 and EDAM_DEVICE_ID_LEN_MAX characters long and must match the regular expression EDAM_DEVICE_ID_REGEX. |
deviceDescription | A description of the device from which the authentication is being performed. This field is displayed to the user in a list of authorized applications to allow them to distinguish between multiple tokens issued to the same client application on different devices. For example, the Evernote iOS client on a user's iPhone and iPad might pass the iOS device names "Bob's iPhone" and "Bob's iPad". The device description must be between 1 and EDAM_DEVICE_DESCRIPTION_LEN_MAX characters long and must match the regular expression EDAM_DEVICE_DESCRIPTION_REGEX. |
supportsTwoFactor | Whether the calling application supports two-factor authentication. If this parameter is false, this method will fail with the error code INVALID_AUTH and the parameter "password" when called for a user who has enabled two-factor authentication. |
- Returns
The result of the authentication. The level of detail provided in the returned AuthenticationResult.User structure depends on the access level granted by calling application's API key.
If the user has two-factor authentication enabled, AuthenticationResult.secondFactorRequired will be set and AuthenticationResult.authenticationToken will contain a short-lived token that may only be used to complete the two-factor authentication process by calling UserStore.completeTwoFactorAuthentication.
- Exceptions
-
EDAMUserException |
-
DATA_REQUIRED "username" - username is empty
-
DATA_REQUIRED "password" - password is empty
-
DATA_REQUIRED "consumerKey" - consumerKey is empty
-
DATA_REQUIRED "consumerSecret" - consumerSecret is empty
-
DATA_REQUIRED "deviceDescription" - deviceDescription is empty
-
BAD_DATA_FORMAT "deviceDescription" - deviceDescription is not valid.
-
BAD_DATA_FORMAT "deviceIdentifier" - deviceIdentifier is not valid.
-
INVALID_AUTH "username" - username not found
-
INVALID_AUTH "password" - password did not match
-
INVALID_AUTH "consumerKey" - consumerKey is not authorized
-
INVALID_AUTH "consumerSecret" - consumerSecret is incorrect
-
PERMISSION_DENIED "User.active" - user account is closed
-
PERMISSION_DENIED "User.tooManyFailuresTryAgainLater" - user has failed authentication too often
|