Tizen Native API
6.5
|
The OAuth 2.0 APIs provide easy way to gain access token between server and client.
Required Header
#include <oauth2.h>
Overview
The OAuth 2.0 authorization framework enables a third-party application to obtain limited access to an HTTP service, either on behalf of a resource owner by orchestrating an approval interaction between the resource owner and the HTTP service, or by allowing the third-party application to obtain access on its own behalf.
Related Features
This API is related with the following features:
- http://tizen.org/feature/oauth2
It is recommended to design feature related codes in your application for reliability.
You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.
To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on featuring your application can be found from Feature List.
Tizen OAuth 2.0 Authorization Framework. Refer to rfc6749 about OAuth 2.0. Also service provider document needs to be referred for using end points and additional parameters.
Functions | |
OAUTH2_API int | oauth2_error_get_code (oauth2_error_h handle, int *server_error_code, int *platform_error_code) |
Gets error code. | |
OAUTH2_API int | oauth2_error_get_description (oauth2_error_h handle, char **description) |
Gets error description. | |
OAUTH2_API int | oauth2_error_get_uri (oauth2_error_h handle, char **uri) |
Gets error uri. | |
OAUTH2_API int | oauth2_error_get_custom_data (oauth2_error_h handle, const char *custom_key, char **custom_value) |
Gets the custom data. | |
OAUTH2_API int | oauth2_manager_create (oauth2_manager_h *handle) |
Creates oauth2_manager_h handle. | |
OAUTH2_API int | oauth2_manager_destroy (oauth2_manager_h handle) |
Destroys oauth2_manager_h handle. | |
OAUTH2_API int | oauth2_manager_request_token (oauth2_manager_h handle, oauth2_request_h request, oauth2_token_cb callback, void *user_data) |
Request OAuth 2.0 access token. | |
OAUTH2_API int | oauth2_manager_request_authorization_grant (oauth2_manager_h handle, oauth2_request_h request, oauth2_auth_grant_cb callback, void *user_data) |
Request authorization grant. | |
OAUTH2_API int | oauth2_manager_request_access_token (oauth2_manager_h handle, oauth2_request_h request, oauth2_access_token_cb callback, void *user_data) |
Requests an access token. | |
OAUTH2_API int | oauth2_manager_refresh_access_token (oauth2_manager_h handle, oauth2_request_h request, oauth2_refresh_token_cb callback, void *user_data) |
Requests a refresh token. | |
OAUTH2_API bool | oauth2_manager_is_request_in_progress (oauth2_manager_h handle) |
Returns whether oauth2_manager related request is pending. | |
OAUTH2_API int | oauth2_manager_clear_cookies (oauth2_manager_h handle) |
Clears the cookies. | |
OAUTH2_API int | oauth2_manager_clear_cache (oauth2_manager_h handle) |
Clears the cache. | |
OAUTH2_API int | oauth2_request_create (oauth2_request_h *handle) |
Creates oauth2_request_h handle. | |
OAUTH2_API int | oauth2_request_destroy (oauth2_request_h handle) |
Destroys oauth2_request_h handle. | |
OAUTH2_API int | oauth2_request_set_auth_end_point_url (oauth2_request_h handle, const char *url) |
Sets authorization end point URL. | |
OAUTH2_API int | oauth2_request_set_token_end_point_url (oauth2_request_h handle, const char *url) |
Sets access token end point URL. | |
OAUTH2_API int | oauth2_request_set_redirection_url (oauth2_request_h handle, const char *url) |
Sets redirection URL. | |
OAUTH2_API int | oauth2_request_set_refresh_token_url (oauth2_request_h handle, const char *url) |
Sets refresh token end point URL. | |
OAUTH2_API int | oauth2_request_set_refresh_token (oauth2_request_h handle, char *refresh_token) |
Sets refresh token. Used mostly while using oauth2_manager_refresh_access_token(). | |
OAUTH2_API int | oauth2_request_set_response_type (oauth2_request_h handle, oauth2_response_type_e response_type) |
Sets response type. | |
OAUTH2_API int | oauth2_request_set_client_id (oauth2_request_h handle, const char *client_id) |
Sets client id. | |
OAUTH2_API int | oauth2_request_set_client_secret (oauth2_request_h handle, const char *client_secret) |
Sets client secret. | |
OAUTH2_API int | oauth2_request_set_client_authentication_type (oauth2_request_h handle, oauth2_client_authentication_type_e client_auth_type) |
Sets client authentication type. Default is OAUTH2_CLIENT_AUTHENTICATION_TYPE_BASIC. | |
OAUTH2_API int | oauth2_request_set_scope (oauth2_request_h handle, const char *scope) |
Sets scope. | |
OAUTH2_API int | oauth2_request_set_state (oauth2_request_h handle, const char *state) |
Sets state. | |
OAUTH2_API int | oauth2_request_set_grant_type (oauth2_request_h handle, oauth2_grant_type_e grant_type) |
Sets grant type. | |
OAUTH2_API int | oauth2_request_set_authorization_code (oauth2_request_h handle, const char *code) |
Sets authorization code. | |
OAUTH2_API int | oauth2_request_set_user_name (oauth2_request_h handle, const char *user_name) |
Sets user name. | |
OAUTH2_API int | oauth2_request_set_password (oauth2_request_h handle, const char *password) |
Sets password. | |
OAUTH2_API int | oauth2_request_add_custom_data (oauth2_request_h handle, const char *key, const char *value) |
Adds custom key-value pair to the request. | |
OAUTH2_API int | oauth2_request_get_auth_end_point_url (oauth2_request_h handle, char **url) |
Gets authorization end point URL. | |
OAUTH2_API int | oauth2_request_get_token_end_point_url (oauth2_request_h handle, char **url) |
Gets access token end point URL. | |
OAUTH2_API int | oauth2_request_get_redirection_url (oauth2_request_h handle, char **url) |
Gets redirection URL. | |
OAUTH2_API int | oauth2_request_get_refresh_token_url (oauth2_request_h handle, char **url) |
Gets refresh token end point URL. | |
OAUTH2_API int | oauth2_request_get_refresh_token (oauth2_request_h handle, char **refresh_token) |
Gets refresh token. | |
OAUTH2_API int | oauth2_request_get_response_type (oauth2_request_h handle, oauth2_response_type_e *response_type) |
Gets response type. | |
OAUTH2_API int | oauth2_request_get_client_id (oauth2_request_h handle, char **client_id) |
Gets client id. | |
OAUTH2_API int | oauth2_request_get_client_secret (oauth2_request_h handle, char **client_secret) |
Gets client secret. | |
OAUTH2_API int | oauth2_request_get_scope (oauth2_request_h handle, char **scope) |
Gets scope. | |
OAUTH2_API int | oauth2_request_get_state (oauth2_request_h handle, char **state) |
Gets state. | |
OAUTH2_API int | oauth2_request_get_grant_type (oauth2_request_h handle, oauth2_grant_type_e *grant_type) |
Gets grant type. | |
OAUTH2_API int | oauth2_request_get_authorization_code (oauth2_request_h handle, char **code) |
Gets authorization code. | |
OAUTH2_API int | oauth2_request_get_user_name (oauth2_request_h handle, char **user_name) |
Gets user name. | |
OAUTH2_API int | oauth2_request_get_password (oauth2_request_h handle, char **password) |
Gets password. | |
OAUTH2_API int | oauth2_request_get_custom_data (oauth2_request_h handle, const char *custom_key, char **custom_value) |
Gets the custom value. | |
OAUTH2_API int | oauth2_response_destroy (oauth2_response_h handle) |
Destroys the received handle. | |
OAUTH2_API int | oauth2_response_get_authorization_code (oauth2_response_h handle, char **code) |
Gets the authorization code. | |
OAUTH2_API int | oauth2_response_get_state (oauth2_response_h handle, char **state) |
Gets state. | |
OAUTH2_API int | oauth2_response_get_access_token (oauth2_response_h handle, char **access_token) |
Gets access token. | |
OAUTH2_API int | oauth2_response_get_token_type (oauth2_response_h handle, char **token_type) |
Gets token type. | |
OAUTH2_API int | oauth2_response_get_expires_in (oauth2_response_h handle, long long *expires_in) |
Gets expiry time. | |
OAUTH2_API int | oauth2_response_get_refresh_token (oauth2_response_h handle, char **refresh_token) |
Gets refresh token. | |
OAUTH2_API int | oauth2_response_get_scope (oauth2_response_h handle, char **scope) |
Gets scope. | |
OAUTH2_API int | oauth2_response_get_error (oauth2_response_h handle, oauth2_error_h *error) |
Gets error. | |
OAUTH2_API int | oauth2_response_get_custom_data (oauth2_response_h handle, const char *custom_key, char **custom_value) |
Gets the custom data. | |
Typedefs | |
typedef struct oauth2_error_s * | oauth2_error_h |
The structure type for OAuth 2.0 Error handle. | |
typedef struct oauth2_manager_s * | oauth2_manager_h |
The structure type for OAuth 2.0 Manager handle. | |
typedef void(* | oauth2_token_cb )(oauth2_response_h response, void *user_data) |
Called when the oauth2_manager_request_token() response comes. | |
typedef void(* | oauth2_auth_grant_cb )(oauth2_response_h response, void *user_data) |
Called when oauth2_manager_request_authorization_grant() response comes. | |
typedef void(* | oauth2_access_token_cb )(oauth2_response_h response, void *user_data) |
Called when oauth2_manager_request_access_token() response comes. | |
typedef void(* | oauth2_refresh_token_cb )(oauth2_response_h response, void *user_data) |
Called when oauth2_manager_refresh_access_token() response comes. | |
typedef struct oauth2_request_s * | oauth2_request_h |
The structure type for OAuth 2.0 Request handle. | |
typedef struct oauth2_response_s * | oauth2_response_h |
The structure type for OAuth 2.0 Response handle. |
Typedef Documentation
typedef void(* oauth2_access_token_cb)(oauth2_response_h response, void *user_data) |
Called when oauth2_manager_request_access_token() response comes.
- Since :
- 2.4
- Parameters:
-
[in] response The response. The response must be released using oauth2_response_destroy(). [in] user_data The user data passed from the callback function.
- Precondition:
- oauth2_manager_request_access_token() must be called to get this callback invoked.
typedef void(* oauth2_auth_grant_cb)(oauth2_response_h response, void *user_data) |
Called when oauth2_manager_request_authorization_grant() response comes.
- Since :
- 2.4
- Parameters:
-
[in] response The response. The response must be released using oauth2_response_destroy(). [in] user_data The user data passed from the callback function.
- Precondition:
- oauth2_manager_request_authorization_grant() must be called to get this callback invoked.
typedef struct oauth2_error_s* oauth2_error_h |
The structure type for OAuth 2.0 Error handle.
- Since :
- 2.4
typedef struct oauth2_manager_s* oauth2_manager_h |
The structure type for OAuth 2.0 Manager handle.
- Since :
- 2.4
typedef void(* oauth2_refresh_token_cb)(oauth2_response_h response, void *user_data) |
Called when oauth2_manager_refresh_access_token() response comes.
- Since :
- 2.4
- Parameters:
-
[in] response The response. The response must be released using oauth2_response_destroy(). [in] user_data The user data passed from the callback function.
- Precondition:
- oauth2_manager_refresh_access_token() must be called to get this callback invoked.
- See also:
- oauth2_manager_refresh_access_token().
typedef struct oauth2_request_s* oauth2_request_h |
The structure type for OAuth 2.0 Request handle.
- Since :
- 2.4
typedef struct oauth2_response_s* oauth2_response_h |
The structure type for OAuth 2.0 Response handle.
- Since :
- 2.4
typedef void(* oauth2_token_cb)(oauth2_response_h response, void *user_data) |
Called when the oauth2_manager_request_token() response comes.
- Since :
- 2.4
- Remarks:
- The response must be released using oauth2_response_destroy().
- Parameters:
-
[in] response The response [in] user_data The user data passed from the callback function
- Precondition:
- oauth2_manager_request_token() must be called to get this callback invoked.
- See also:
- oauth2_manager_request_token()
Enumeration Type Documentation
Enumerations for Client authentication scheme, used to sign client id and client secret accordingly.
- Since :
- 2.4
- Remarks:
- Facebook and Google does not support HTTP Basic Authentication, instead they require client credentials to be sent via request body. Default is OAUTH2_CLIENT_AUTHENTICATION_TYPE_BASIC (rfc2617::section-2)
enum oauth2_error_e |
Enumerations of error codes for oauth2 APIs.
- Since :
- 2.4
- Enumerator:
enum oauth2_grant_type_e |
Enumerations to set grant_type.
- Since :
- 2.4
- See also:
- oauth2_request_set_grant_type()
- Enumerator:
Function Documentation
OAUTH2_API int oauth2_error_get_code | ( | oauth2_error_h | handle, |
int * | server_error_code, | ||
int * | platform_error_code | ||
) |
Gets error code.
- Since :
- 2.4
- Remarks:
- You must not release server_error_code and platform_error_code using free().
- Parameters:
-
[in] handle The error handle [out] server_error_code Error code (if any) returned by the server [out] platform_error_code Tizen platform related error code (if any), value is of type oauth2_error_e
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_error_get_custom_data | ( | oauth2_error_h | handle, |
const char * | custom_key, | ||
char ** | custom_value | ||
) |
Gets the custom data.
- Since :
- 2.4
- Remarks:
- You must not release custom_value using free().
- Parameters:
-
[in] handle The error handle [in] custom_key The custom key [out] custom_value The custom value
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_error_get_description | ( | oauth2_error_h | handle, |
char ** | description | ||
) |
Gets error description.
- Since :
- 2.4
- Remarks:
- You must not release description using free().
- Parameters:
-
[in] handle The error handle [out] description The Error description
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_error_get_uri | ( | oauth2_error_h | handle, |
char ** | uri | ||
) |
Gets error uri.
- Since :
- 2.4
- Remarks:
- You must not release uri using free().
- Parameters:
-
[in] handle The error handle [out] uri The Error URI
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_manager_clear_cache | ( | oauth2_manager_h | handle | ) |
Clears the cache.
- Since :
- 2.4
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/internet
- Parameters:
-
[in] handle The oauth2 manager handle.
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_PERMISSION_DENIED Permission denied. OAUTH2_ERROR_NOT_SUPPORTED Not supported.
OAUTH2_API int oauth2_manager_clear_cookies | ( | oauth2_manager_h | handle | ) |
Clears the cookies.
- Since :
- 2.4
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/internet
- Parameters:
-
[in] handle The oauth2 manager handle.
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_PERMISSION_DENIED Permission denied. OAUTH2_ERROR_NOT_SUPPORTED Not supported.
OAUTH2_API int oauth2_manager_create | ( | oauth2_manager_h * | handle | ) |
Creates oauth2_manager_h handle.
- Remarks:
- The handle must be released using oauth2_manager_destroy().
- Since :
- 2.4
- Parameters:
-
[out] handle The created handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_NOT_SUPPORTED Not supported
- See also:
- oauth2_manager_destroy()
OAUTH2_API int oauth2_manager_destroy | ( | oauth2_manager_h | handle | ) |
Destroys oauth2_manager_h handle.
- Since :
- 2.4
- Parameters:
-
[in] handle The oauth2 manager handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API bool oauth2_manager_is_request_in_progress | ( | oauth2_manager_h | handle | ) |
Returns whether oauth2_manager related request is pending.
- Since :
- 2.4
- Parameters:
-
[in] handle The auth2 manager handle.
- Return values:
-
false No pending request true There is pending request. OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_manager_refresh_access_token | ( | oauth2_manager_h | handle, |
oauth2_request_h | request, | ||
oauth2_refresh_token_cb | callback, | ||
void * | user_data | ||
) |
Requests a refresh token.
The response is delivered via oauth2_refresh_token_cb() callback.
- Since :
- 2.4
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/internet
- Remarks:
- The "internet" privilege is required to call this API. Note, only one pending request is allowed at a time.
- Parameters:
-
[in] handle The oauth2 manager handle. [in] request The request handle. [in] callback The application callback. [in] user_data The user data to be passed to the callback function.
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of memory. OAUTH2_ERROR_INVALID_PARAMETER Invalid input parameter(s) passed. OAUTH2_ERROR_ALREADY_IN_PROGRESS The previous request is already in progress. OAUTH2_ERROR_PERMISSION_DENIED Permission denied. OAUTH2_ERROR_NOT_SUPPORTED Not supported. OAUTH2_ERROR_PARSE_FAILED Parsing failed. OAUTH2_ERROR_NETWORK_ERROR Network Error. OAUTH2_ERROR_UNKNOWN Unknown system error.
OAUTH2_API int oauth2_manager_request_access_token | ( | oauth2_manager_h | handle, |
oauth2_request_h | request, | ||
oauth2_access_token_cb | callback, | ||
void * | user_data | ||
) |
Requests an access token.
The response is delivered via oauth2_access_token_cb() callback.
- Since :
- 2.4
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/internet
- Remarks:
- The "internet" privilege is required to call this API. Note, only one pending request is allowed at a time.
- Parameters:
-
[in] handle The oauth2_manager handle. [in] request The request handle. [in] callback The application callback. [in] user_data The user data to be passed to the callback function.
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of memory. OAUTH2_ERROR_INVALID_PARAMETER Invalid input parameter(s) passed. OAUTH2_ERROR_ALREADY_IN_PROGRESS The previous request is already in progress. OAUTH2_ERROR_PERMISSION_DENIED Permission denied. OAUTH2_ERROR_NOT_SUPPORTED Not supported. OAUTH2_ERROR_PARSE_FAILED Parsing failed. OAUTH2_ERROR_NETWORK_ERROR Network Error. OAUTH2_ERROR_UNKNOWN Unknown system error.
OAUTH2_API int oauth2_manager_request_authorization_grant | ( | oauth2_manager_h | handle, |
oauth2_request_h | request, | ||
oauth2_auth_grant_cb | callback, | ||
void * | user_data | ||
) |
Request authorization grant.
The response is delivered via oauth2_auth_grant_cb().
- Since :
- 2.4
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/internet
- Remarks:
- The "internet" privilege is required to call this API. Note, only one pending request is allowed at a time.
- Parameters:
-
[in] handle The oauth2_manager handle. [in] request The request handle. [in] callback The application callback. [in] user_data The user data to be passed to the callback function.
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of memory. OAUTH2_ERROR_INVALID_PARAMETER Invalid input parameter(s) passed. OAUTH2_ERROR_ALREADY_IN_PROGRESS The previous request is already in progress. OAUTH2_ERROR_PERMISSION_DENIED Permission denied. OAUTH2_ERROR_NOT_SUPPORTED Not supported. OAUTH2_ERROR_PARSE_FAILED Parsing failed. OAUTH2_ERROR_NETWORK_ERROR Network Error. OAUTH2_ERROR_UNKNOWN Unknown system error.
OAUTH2_API int oauth2_manager_request_token | ( | oauth2_manager_h | handle, |
oauth2_request_h | request, | ||
oauth2_token_cb | callback, | ||
void * | user_data | ||
) |
Request OAuth 2.0 access token.
The response is delivered via oauth2_token_cb().
- Since :
- 2.4
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/internet
- Remarks:
- The "internet" privilege is required to call this API. Note, only one pending request is allowed.
- Parameters:
-
[in] handle The oauth2 manager handle. [in] request The request handle. [in] callback The callback to receive response. [in] user_data The user data to be passed to the callback function.
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of memory. OAUTH2_ERROR_INVALID_PARAMETER Invalid input parameter(s) passed. OAUTH2_ERROR_ALREADY_IN_PROGRESS The previous request is already in progress. OAUTH2_ERROR_PERMISSION_DENIED Permission denied. OAUTH2_ERROR_NOT_SUPPORTED Not supported. OAUTH2_ERROR_PARSE_FAILED Parsing failed. OAUTH2_ERROR_NETWORK_ERROR Network Error. OAUTH2_ERROR_UNKNOWN Unknown system error.
OAUTH2_API int oauth2_request_add_custom_data | ( | oauth2_request_h | handle, |
const char * | key, | ||
const char * | value | ||
) |
Adds custom key-value pair to the request.
- Since :
- 2.4
- Parameters:
-
[in] handle The request handle [in] key The key [in] value The value
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_NOT_SUPPORTED Not supported
- See also:
- oauth2_request_get_custom_data()
OAUTH2_API int oauth2_request_create | ( | oauth2_request_h * | handle | ) |
Creates oauth2_request_h handle.
The handle must be freed via oauth2_request_destroy().
- Since :
- 2.4
- Parameters:
-
[out] handle The created oauth2_request handle, else NULL for error cases
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_destroy | ( | oauth2_request_h | handle | ) |
Destroys oauth2_request_h handle.
- Since :
- 2.4
- Parameters:
-
[in] handle The oauth2_request handle to destroy
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_get_auth_end_point_url | ( | oauth2_request_h | handle, |
char ** | url | ||
) |
Gets authorization end point URL.
- Since :
- 2.4
- Remarks:
- You must not release url using free().
- Parameters:
-
[in] handle The request handle [out] url The url
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_get_authorization_code | ( | oauth2_request_h | handle, |
char ** | code | ||
) |
Gets authorization code.
- Since :
- 2.4
- Remarks:
- You must not release code using free().
- Parameters:
-
[in] handle The request handle. [out] code The code.
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_get_client_id | ( | oauth2_request_h | handle, |
char ** | client_id | ||
) |
Gets client id.
- Since :
- 2.4
- Remarks:
- You must not release client_id using free().
- Parameters:
-
[in] handle The request handle [out] client_id The client id
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_get_client_secret | ( | oauth2_request_h | handle, |
char ** | client_secret | ||
) |
Gets client secret.
- Since :
- 2.4
- Remarks:
- You must not release client_secret using free().
- Parameters:
-
[in] handle The request handle [out] client_secret The client_secret
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_get_custom_data | ( | oauth2_request_h | handle, |
const char * | custom_key, | ||
char ** | custom_value | ||
) |
Gets the custom value.
- Since :
- 2.4
- Remarks:
- You must not release custom_value using free().
- Parameters:
-
[in] handle The request handle [in] custom_key The custom key [out] custom_value The custom value
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_get_grant_type | ( | oauth2_request_h | handle, |
oauth2_grant_type_e * | grant_type | ||
) |
Gets grant type.
- Since :
- 2.4
- Remarks:
- You must not release grant_type using free().
- Parameters:
-
[in] handle The request handle [out] grant_type The grant type
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_get_password | ( | oauth2_request_h | handle, |
char ** | password | ||
) |
Gets password.
- Since :
- 2.4
- Remarks:
- You must not release password using free().
- Parameters:
-
[in] handle The request handle [out] password The password
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_get_redirection_url | ( | oauth2_request_h | handle, |
char ** | url | ||
) |
Gets redirection URL.
- Since :
- 2.4
- Remarks:
- You must not release url using free().
- Parameters:
-
[in] handle The request handle [out] url The url
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_get_refresh_token | ( | oauth2_request_h | handle, |
char ** | refresh_token | ||
) |
Gets refresh token.
- Since :
- 2.4
- Remarks:
- You must not release refresh_token using free().
- Parameters:
-
[in] handle The request handle [out] refresh_token The refresh token
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_get_refresh_token_url | ( | oauth2_request_h | handle, |
char ** | url | ||
) |
Gets refresh token end point URL.
- Since :
- 2.4
- Remarks:
- You must not release url using free().
- Parameters:
-
[in] handle The request handle [out] url The url
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_get_response_type | ( | oauth2_request_h | handle, |
oauth2_response_type_e * | response_type | ||
) |
Gets response type.
- Since :
- 2.4
- Remarks:
- You must not free response_type
- Parameters:
-
[in] handle The request handle [out] response_type The response type
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_get_scope | ( | oauth2_request_h | handle, |
char ** | scope | ||
) |
Gets scope.
- Since :
- 2.4
- Remarks:
- You must not release scope using free().
- Parameters:
-
[in] handle The request handle [out] scope The scope
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_get_state | ( | oauth2_request_h | handle, |
char ** | state | ||
) |
Gets state.
- Since :
- 2.4
- Remarks:
- You must not release state using free().
- Parameters:
-
[in] handle The request handle [out] state The state
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_get_token_end_point_url | ( | oauth2_request_h | handle, |
char ** | url | ||
) |
Gets access token end point URL.
- Since :
- 2.4
- Remarks:
- You must not release url using free().
- Parameters:
-
[in] handle The request handle [out] url The url
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_get_user_name | ( | oauth2_request_h | handle, |
char ** | user_name | ||
) |
Gets user name.
- Since :
- 2.4
- Remarks:
- You must not release user_name using free().
- Parameters:
-
[in] handle The request handle [out] user_name The user name
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_set_auth_end_point_url | ( | oauth2_request_h | handle, |
const char * | url | ||
) |
Sets authorization end point URL.
- Since :
- 2.4
- Parameters:
-
[in] handle The request handle [in] url The url
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_set_authorization_code | ( | oauth2_request_h | handle, |
const char * | code | ||
) |
Sets authorization code.
- Since :
- 2.4
- Parameters:
-
[in] handle The request handle [in] code The authorization code
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_set_client_authentication_type | ( | oauth2_request_h | handle, |
oauth2_client_authentication_type_e | client_auth_type | ||
) |
Sets client authentication type. Default is OAUTH2_CLIENT_AUTHENTICATION_TYPE_BASIC.
- Since :
- 2.4
- Remarks:
- Facebook and Google does not support HTTP Basic Authentication, instead they require client credentials to be sent via request body.
So application must set OAUTH2_CLIENT_AUTHENTICATION_TYPE_REQUEST_BODY for them.
- Parameters:
-
[in] handle The request handle [in] client_auth_type The client authentication type
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_set_client_id | ( | oauth2_request_h | handle, |
const char * | client_id | ||
) |
Sets client id.
- Since :
- 2.4
- Parameters:
-
[in] handle The request handle [in] client_id The client id
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_set_client_secret | ( | oauth2_request_h | handle, |
const char * | client_secret | ||
) |
Sets client secret.
- Since :
- 2.4
- Parameters:
-
[in] handle The request handle [in] client_secret The secret
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_set_grant_type | ( | oauth2_request_h | handle, |
oauth2_grant_type_e | grant_type | ||
) |
Sets grant type.
- Since :
- 2.4
- Parameters:
-
[in] handle The request handle [in] grant_type The grant type
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_set_password | ( | oauth2_request_h | handle, |
const char * | password | ||
) |
Sets password.
- Since :
- 2.4
- Parameters:
-
[in] handle The request handle [in] password The password
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_set_redirection_url | ( | oauth2_request_h | handle, |
const char * | url | ||
) |
Sets redirection URL.
- Since :
- 2.4
- Parameters:
-
[in] handle The request handle [in] url The url
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_set_refresh_token | ( | oauth2_request_h | handle, |
char * | refresh_token | ||
) |
Sets refresh token. Used mostly while using oauth2_manager_refresh_access_token().
- Since :
- 2.4
- Parameters:
-
[in] handle The request handle [in] refresh_token The refresh token string
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_set_refresh_token_url | ( | oauth2_request_h | handle, |
const char * | url | ||
) |
Sets refresh token end point URL.
- Since :
- 2.4
- Parameters:
-
[in] handle The request handle [in] url The url
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_set_response_type | ( | oauth2_request_h | handle, |
oauth2_response_type_e | response_type | ||
) |
Sets response type.
- Since :
- 2.4
- Parameters:
-
[in] handle The request handle [in] response_type The response type
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_set_scope | ( | oauth2_request_h | handle, |
const char * | scope | ||
) |
Sets scope.
- Since :
- 2.4
- Parameters:
-
[in] handle The request handle [in] scope The scope
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_set_state | ( | oauth2_request_h | handle, |
const char * | state | ||
) |
Sets state.
- Since :
- 2.4
- Parameters:
-
[in] handle The request handle [in] state The state
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_set_token_end_point_url | ( | oauth2_request_h | handle, |
const char * | url | ||
) |
Sets access token end point URL.
- Since :
- 2.4
- Parameters:
-
[in] handle The request handle [in] url The url
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_request_set_user_name | ( | oauth2_request_h | handle, |
const char * | user_name | ||
) |
Sets user name.
- Since :
- 2.4
- Parameters:
-
[in] handle The request handle [in] user_name The user name
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_response_destroy | ( | oauth2_response_h | handle | ) |
Destroys the received handle.
- Since :
- 2.4
- Parameters:
-
[in] handle The response handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_response_get_access_token | ( | oauth2_response_h | handle, |
char ** | access_token | ||
) |
Gets access token.
- Since :
- 2.4
- Remarks:
- You must not release access_token using free().
- Parameters:
-
[in] handle The response handle [out] access_token The access token
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_response_get_authorization_code | ( | oauth2_response_h | handle, |
char ** | code | ||
) |
Gets the authorization code.
- Since :
- 2.4
- Remarks:
- You must not release code using free().
- Parameters:
-
[in] handle The response handle [out] code The code.
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_response_get_custom_data | ( | oauth2_response_h | handle, |
const char * | custom_key, | ||
char ** | custom_value | ||
) |
Gets the custom data.
Some service providers send additional keys not specified in OAuth 2.0 RFC. To get those additional fields this API needs to be used.
- Since :
- 2.4
- Remarks:
- You must not release custom_value using free().
- Parameters:
-
[in] handle The response handle [in] custom_key The custom key [out] custom_value The custom value
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_response_get_error | ( | oauth2_response_h | handle, |
oauth2_error_h * | error | ||
) |
Gets error.
- Since :
- 2.4
- Remarks:
- You must not release error using free().
- Parameters:
-
[in] handle The response handle [out] error The error structure
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
- See also:
- oauth2_error_h
OAUTH2_API int oauth2_response_get_expires_in | ( | oauth2_response_h | handle, |
long long * | expires_in | ||
) |
Gets expiry time.
- Since :
- 2.4
- Remarks:
- You must not release expires_in using free().
- Parameters:
-
[in] handle The response handle [out] expires_in Expiry value
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_response_get_refresh_token | ( | oauth2_response_h | handle, |
char ** | refresh_token | ||
) |
Gets refresh token.
- Since :
- 2.4
- Remarks:
- You must not release refresh_token using free().
- Parameters:
-
[in] handle The response handle [out] refresh_token The refresh token
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_response_get_scope | ( | oauth2_response_h | handle, |
char ** | scope | ||
) |
Gets scope.
- Since :
- 2.4
- Remarks:
- You must not release scope using free().
- Parameters:
-
[in] handle The response handle [out] scope The scope
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_response_get_state | ( | oauth2_response_h | handle, |
char ** | state | ||
) |
Gets state.
- Since :
- 2.4
- Remarks:
- You must not release state using free().
- Parameters:
-
[in] handle The response handle [out] state The state.
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported
OAUTH2_API int oauth2_response_get_token_type | ( | oauth2_response_h | handle, |
char ** | token_type | ||
) |
Gets token type.
- Since :
- 2.4
- Remarks:
- You must not release token_type using free().
- Parameters:
-
[in] handle The response handle [out] token_type The token type
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
OAUTH2_ERROR_NONE Successful OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter OAUTH2_ERROR_VALUE_NOT_FOUND Value not found OAUTH2_ERROR_NOT_SUPPORTED Not supported