ids_clear_token()

Issue a request to clear a token.

Synopsis:

#include <ids.h>
 
IDS_API ids_result_t ids_clear_token(ids_provider_t *provider, const char *token_type, const char *applies_to, clear_token_cb_t success_cb, failure_cb_t failure_cb, void *cb_data, ids_request_id_t *request_id)

Since:

BlackBerry 10.2.0

Arguments:

provider

A pointer to the identity provider to send this request to.

token_type

A pointer to the token type. It cannot be set to NULL and the value must be between 1 and 32 characters, inclusive.

applies_to

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.

success_cb

A pointer to the function that is invoked upon successful operation of this function.

failure_cb

A pointer to the function that is invoked when this function fails. This callback contains an errorCode parameter to specify the failure condition.

cb_data

This parameter can be set to NULL if callback data is not required. This pointer for callback data is passed in 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.

request_id

A pointer to the request ID that can be used to match the response to the request.

Library:

libids (For the qcc command, use the -l ids option to link against this library)

Description:

In cases where the token seems to be invalid or too close to expiry to be deemed useful, an application can clear the currently cached token in order to retrieve a newly generated token in the next ids_get_token() call.

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 the 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.

Returns:

IDS_SUCCESS when the request is issued successfully, or IDS_FAILURE with the errno value set otherwise.