Issue a get token request.
#include <ids.h>
IDS_API ids_result_t ids_get_token(ids_provider_t *provider, const char *token_type, const char *applies_to, get_token_cb_t success_cb, failure_cb_t failure_cb, void *cb_data, ids_request_id_t *request_id)
BlackBerry 10.2.0
A pointer to the identity provider to send this request to.
A pointer to the token type. It cannot be set to NULL and the value must be between 1 and 32 characters, inclusive.
A pointer to the application or service that the token applies to. It cannot be set to NULL and the value must be between 1 and 96 characters, inclusive.
The function that is invoked upon successful operation of this function.
The function that is invoked when this function fails. This callback contains an errorCode parameter to specify the failure condition.
This parameter can be set to NULL if callback data is not required. This pointer for callback data is passed to the calling application's success or failure callback without being modified. The application can determine whether it passes it in to the API or leaves it NULL, and also determine how to use it in the callback functions.
An updated pointer to the request ID that can be used to match the response to the request.
Error Handling:
The value of errno when IDS_FAILURE is returned can be one of the following: EFAULT: The library has not been initialized.E2BIG: The message is too big to send to the identity provider.ECOMM: Unable to communicate with identity provider.EINVAL: An invalid parameter was passed to the function.ENOMEM: There is not enough memory to complete the operation.
Requests that do not complete successfully result in the failure callback being called with one of the following result codes: IDS_DEFAULT_ERROR: An internal error occurred while attempting to process the request.IDS_NOT_READY: The identity provider is not ready to process the request.IDS_UNKNOWN_APPLIES_TO: The applies_to value is not valid.IDS_UNKNOWN_TOKEN_TYPE: The token_type value is not valid.IDS_NOT_ENOUGH_RESOURCES: There are not enough resources available to process the request.IDS_ACCOUNT_LOCALLY_LOCKED_OUT: The account is currently locked, token access is unavailable while the account is locked.IDS_USER_COULD_NOT_BE_AUTHENTICATED: The user could not be authenticated.IDS_CANNOT_GET_TOKEN_WHILE_OFFLINE: The service is currently offline and cannot retrieve the requested token.IDS_ERROR_WHILE_CONTACTING_SERVICE: An error occurred communicating with the service.
IDS_SUCCESS when the request is issued successfully. IDS_FAILURE with the errno value set otherwise.