#ifndef _OAUTH2_H_
#define _OAUTH2_H_
-#include "oauth2_manager.h"
-#include "oauth2_request.h"
-#include "oauth2_response.h"
-#include "oauth2_error.h"
-#include "oauth2_types.h"
+#include <oauth2_manager.h>
+#include <oauth2_request.h>
+#include <oauth2_response.h>
+#include <oauth2_error.h>
+#include <oauth2_types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
/**
* Tizen OAuth 2.0 Authorization Framework.
- * Refer to http://tools.ietf.org/html/rfc6749 about OAuth 2.0. Also service provider document needs to be referred for using end points and additional parameters.
+ * Refer to <a href="http://tools.ietf.org/html/rfc6749">rfc6749</a> about OAuth 2.0. Also service provider document needs to be referred for using end points and additional parameters.
*/
/**
* @{
*/
-/* End of OAuth 2.0 APIs */
/**
* @}
*/
+#ifdef __cplusplus
+}
+#endif
+
#endif // _OAUTH2_H_
#ifndef OAUTH2_ERROR_H_
#define OAUTH2_ERROR_H_
-#include "oauth2_types.h"
-#include <bundle.h>
#include <tizen_error.h>
+#include <bundle.h>
+#include <oauth2_types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
/**
* @file oauth2_error.h
/**
* @brief The structure type for OAuth 2.0 Error handle.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
-
*/
typedef struct oauth2_error_s *oauth2_error_h;
/**
* @brief Gets error code.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free server_error_code and platform_error_code
- * @param[in] handle The error handle.
- * @param [out] server_error_code Error code (if any) returned by the server.
- * @param [out] platform_error_code Tizen platform related error code (if any), value is of type oauth2_error_e
+ * @remarks You must not release @a server_error_code and @a platform_error_code using free().
+ * @param[in] handle The error handle
+ * @param[out] server_error_code Error code (if any) returned by the server
+ * @param[out] platform_error_code Tizen platform related error code (if any), value is of type #oauth2_error_e
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Gets error description.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free description
- * @param[in] handle The error handle.
- * @param[out] description The Error description.
+ * @remarks You must not release @a description using free().
+ * @param[in] handle The error handle
+ * @param[out] description The Error description
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Gets error uri.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free uri
- * @param[in] handle The error handle.
- * @param[out] uri The Error URI.
+ * @remarks You must not release @a uri using free().
+ * @param[in] handle The error handle
+ * @param[out] uri The Error URI
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Gets the custom data.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free custom_value
- * @param[in] handle The error handle.
- * @param[in] custom_key The custom key.
- * @param[out] custom_value The custom value.
+ * @remarks You must not release @a custom_value using free().
+ * @param[in] handle The error handle
+ * @param[in] custom_key The custom key
+ * @param[out] custom_value The custom value
*
* @return @c 0 on success,
* otherwise a negative error value
*/
OAUTH2_API int oauth2_error_get_custom_data(oauth2_error_h handle, const char *custom_key, char **custom_value);
-/* End of OAuth 2.0 APIs */
/**
* @}
*/
+#ifdef __cplusplus
+}
+#endif
+
#endif /* OAUTH2_ERROR_H_ */
#include <stdbool.h>
-#include "oauth2_request.h"
-#include "oauth2_response.h"
-#include "oauth2_error.h"
-#include "oauth2_types.h"
+#include <oauth2_request.h>
+#include <oauth2_response.h>
+#include <oauth2_error.h>
+#include <oauth2_types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
/**
* @file oauth2_manager.h
/**
* @brief Creates oauth2_manager_h handle.
- * @remarks It must be freed using oauth2_manager_destroy().
+ * @remarks The @a handle must be released using oauth2_manager_destroy().
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
* @param[out] handle The created handle
* @return @c 0 on success,
/**
* @brief Destroys oauth2_manager_h handle.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @param[in] handle The oauth2_manager handle.
+ * @param[in] handle The oauth2 manager handle
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Called when the oauth2_manager_request_token() resopnse comes.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ * @remarks The @a response must be released using oauth2_response_destroy().
*
- * param[in] response The response. The response must be released using oauth2_response_destroy().
- * param[in] user_data The user data passed from the callback function.
+ * @param[in] response The response
+ * @param[in] user_data The user data passed from the callback function
*
* @pre oauth2_manager_request_token() must be called to get this callback invoked.
* @see oauth2_manager_request_token()
/**
* @brief Request OAuth 2.0 access token.
* @details The response is delivered via oauth2_token_cb().
- * "internet" privilege is required to call this API. Note, only one pending request is allowed.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/internet
+ * @remarks The "internet" privilege is required to call this API. Note, only one pending request is allowed.
*
- * @param[in] handle The oauth2_manager_handle.
+ * @param[in] handle The oauth2 manager handle.
* @param[in] request The request handle.
* @param[in] callback The callback to receive response.
- * @param[in] user_data The user data to be passed to the callback function.
+ * @param[in] user_data The user data to be passed to the callback function.
*
+ * @return @c 0 on success,
+ * otherwise a negative error value
* @retval #OAUTH2_ERROR_NONE Successful
* @retval #OAUTH2_ERROR_OUT_OF_MEMORY Out of memory.
* @retval #OAUTH2_ERROR_INVALID_PARAMETER Invalid input parameter(s) passed.
* @brief Called when oauth2_manager_request_authorization_grant() response comes.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
*
- * @param[in] response The response. The response must be released using oauth2_response_destroy().
- * param[in] user_data The user data passed from the callback function.
+ * @param[in] response The response. The @a response must be released using oauth2_response_destroy().
+ * @param[in] user_data The user data passed from the callback function.
*
* @pre oauth2_manager_request_authorization_grant() must be called to get this callback invoked.
* @see oauth2_manager_request_authorization_grant()
/**
* @brief Request authorization grant.
* @details The response is delivered via oauth2_auth_grant_cb().
- * "internet" privilege is required to call this API. Note, only one pending request is allowed at a time.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
* @privlevel 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.
*
* @param[in] handle The oauth2_manager handle.
* @param[in] request The request handle.
* @param[in] callback The application callback.
- * @param[in] user_data The user data to be passed to the callback function.
+ * @param[in] user_data The user data to be passed to the callback function.
*
+ * @return @c 0 on success,
+ * otherwise a negative error value
* @retval #OAUTH2_ERROR_NONE Successful
* @retval #OAUTH2_ERROR_OUT_OF_MEMORY Out of memory.
* @retval #OAUTH2_ERROR_INVALID_PARAMETER Invalid input parameter(s) passed.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
*
* @param[in] response The response. The response must be released using oauth2_response_destroy().
- * param[in] user_data The user data passed from the callback function.
+ * @param[in] user_data The user data passed from the callback function.
*
* @pre oauth2_manager_request_access_token() must be called to get this callback invoked.
* @see oauth2_manager_request_access_token()
/**
* @brief Requests an access token.
* @details The response is delivered via oauth2_access_token_cb() callback.
- * "internet" privilege is required to call this API. Note, only one pending request is allowed at a time.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
* @privlevel 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.
*
* @param[in] handle The oauth2_manager handle.
* @param[in] request The request handle.
* @param[in] callback The application callback.
- * @param[in] user_data The user data to be passed to the callback function.
+ * @param[in] user_data The user data to be passed to the callback function.
*
+ * @return @c 0 on success,
+ * otherwise a negative error value
* @retval #OAUTH2_ERROR_NONE Successful
* @retval #OAUTH2_ERROR_OUT_OF_MEMORY Out of memory.
* @retval #OAUTH2_ERROR_INVALID_PARAMETER Invalid input parameter(s) passed.
* @brief Called when oauth2_manager_refresh_access_token() response comes.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
*
- * @param[in] response The response. The response must be released using oauth2_response_destroy().
- * param[in] user_data The user data passed from the callback function.
+ * @param[in] response The response. The @a response must be released using oauth2_response_destroy().
+ * @param[in] user_data The user data passed from the callback function.
*
* @pre oauth2_manager_refresh_access_token() must be called to get this callback invoked.
* @see oauth2_manager_refresh_access_token().
/**
* @brief Requests a refresh token.
* @details The response is delivered via oauth2_refresh_token_cb() callback.
- * "internet" privilege is required to call this API. Note, only one pending request is allowed at a time.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
* @privlevel 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.
*
- * @param[in] handle The oauth2_manager handle.
+ * @param[in] handle The oauth2 manager handle.
* @param[in] request The request handle.
* @param[in] callback The application callback.
* @param[in] user_data The user data to be passed to the callback function.
*
+ * @return @c 0 on success,
+ * otherwise a negative error value
* @retval #OAUTH2_ERROR_NONE Successful
* @retval #OAUTH2_ERROR_OUT_OF_MEMORY Out of memory.
* @retval #OAUTH2_ERROR_INVALID_PARAMETER Invalid input parameter(s) passed.
* @brief Returns whether oauth2_manager related request is pending.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
*
- * @param[in] handle The auth2_manager handle.
+ * @param[in] handle The auth2 manager handle.
* @retval false No pending request
* @retval true There is pending request.
*/
* @privlevel public
* @privilege %http://tizen.org/privilege/internet
*
- * @param[in] handle The oauth2_manager handle.
+ * @param[in] handle The oauth2 manager handle.
*
* @return @c 0 on success,
* otherwise a negative error value
* @privlevel public
* @privilege %http://tizen.org/privilege/internet
*
- * @param[in] handle The oauth2_manager handle.
+ * @param[in] handle The oauth2 manager handle.
*
* @return @c 0 on success,
* otherwise a negative error value
*/
OAUTH2_API int oauth2_manager_clear_cache(oauth2_manager_h handle);
-/* End of OAuth 2.0 APIs */
/**
* @}
*/
+#ifdef __cplusplus
+}
+#endif
+
#endif /* OAUTH2_MANAGER_H_ */
#include <bundle.h>
#include <curl/curl.h>
-#include "oauth2_types.h"
+#include <oauth2_types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
/**
* @file oauth2_request.h
* @brief Creates oauth2_request_h handle.
* @details The handle must be freed via oauth2_request_destroy().
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @param[out] handle The created oauth2_request handle, else NULL for error cases.
+ * @param[out] handle The created oauth2_request handle, else NULL for error cases
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Destroys oauth2_request_h handle.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @param[in] handle The oauth2_request handle to destory.
+ * @param[in] handle The oauth2_request handle to destory
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Sets authorization end point URL.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @param[in] handle The request handle.
- * @param[in] url The url.
+ * @param[in] handle The request handle
+ * @param[in] url The url
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Sets access token end point URL.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @param[in] handle The request handle.
- * @param[in] url The url.
+ * @param[in] handle The request handle
+ * @param[in] url The url
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Sets redirection URL.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @param[in] handle The request handle.
- * @param[in] url The url.
+ * @param[in] handle The request handle
+ * @param[in] url The url
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Sets refresh token end point URL.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @param[in] handle The request handle.
- * @param[in] url The url.
+ * @param[in] handle The request handle
+ * @param[in] url The url
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Sets refresh token. Used mostly while using oauth2_manager_refresh_access_token().
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @param[in] handle The request handle.
- * @param[in] refresh_token The refresh token string.
+ * @param[in] handle The request handle
+ * @param[in] refresh_token The refresh token string
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Sets response type.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @param[in] handle The request handle.
- * @param[in] response_type The response type.
+ * @param[in] handle The request handle
+ * @param[in] response_type The response type
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Sets client id.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @param[in] handle The request handle.
- * @param[in] client_id The client id.
+ * @param[in] handle The request handle
+ * @param[in] client_id The client id
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Sets client secret.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @param[in] handle The request handle.
- * @param[in] client_secret The secret.
+ * @param[in] handle The request handle
+ * @param[in] client_secret The secret
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Sets client authentication type. Default is OAUTH2_CLIENT_AUTHENTICATION_TYPE_BASIC.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @param[in] handle The request handle.
- * @param[in] client_auth_type The client authentication type.
+ * @remarks Facebook and Google does not support HTTP Basic Authentication, instead they require client credentials to be sent via request body.\n
+ * So application must set #OAUTH2_CLIENT_AUTHENTICATION_TYPE_REQUEST_BODY for them.
+ *
+ * @param[in] handle The request handle
+ * @param[in] client_auth_type The client authentication type
*
* @return @c 0 on success,
* otherwise a negative error value
* @retval #OAUTH2_ERROR_NONE Successful
* @retval #OAUTH2_ERROR_OUT_OF_MEMORY Out of Memory
* @retval #OAUTH2_ERROR_INVALID_PARAMETER Invalid parameter
- *
- * @remarks Facebook and Google does not support HTTP Basic Authentication, instead they require client credentials to be sent via request body.\n
- * So application must set OAUTH2_CLIENT_AUTHENTICATION_TYPE_REQUEST_BODY for them.
*/
OAUTH2_API int oauth2_request_set_client_authentication_type(oauth2_request_h handle, oauth2_client_authentication_type_e client_auth_type);
/**
* @brief Sets scope.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @param[in] handle The request handle.
- * @param[in] scope The scope.
+ * @param[in] handle The request handle
+ * @param[in] scope The scope
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Sets state.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @param[in] handle The request handle.
- * @param[in] state The state.
+ * @param[in] handle The request handle
+ * @param[in] state The state
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Sets grant type.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @param[in] handle The request handle.
- * @param[in] grant_type The grant type.
+ * @param[in] handle The request handle
+ * @param[in] grant_type The grant type
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Sets authorization code.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @param[in] handle The request handle.
- * @param[in] code The authorization code.
+ * @param[in] handle The request handle
+ * @param[in] code The authorization code
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Sets user name.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @param[in] handle The request handle.
- * @param[in] user_name The user name.
+ * @param[in] handle The request handle
+ * @param[in] user_name The user name
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Sets password.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @param[in] handle The request handle.
- * @param[in] password The password.
+ * @param[in] handle The request handle
+ * @param[in] password The password
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Adds custom key-value pair to the request.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @param[in] handle The request handle.
- * @param[in] key The key.
- * @param[in] value The value.
+ * @param[in] handle The request handle
+ * @param[in] key The key
+ * @param[in] value The value
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Gets authorization end point URL.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free url
- * @param[in] handle The request handle.
- * @param[out] url The url.
+ * @remarks You must not release @a url using free().
+ * @param[in] handle The request handle
+ * @param[out] url The url
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Gets access token end point URL.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free url
- * @param[in] handle The request handle.
- * @param[out] url The url.
+ * @remarks You must not release @a url using free().
+ * @param[in] handle The request handle
+ * @param[out] url The url
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Gets redirection URL.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free url
- * @param[in] handle The request handle.
- * @param[out] url The url.
+ * @remarks You must not release @a url using free().
+ * @param[in] handle The request handle
+ * @param[out] url The url
*
* @return @c 0 on success,
* otherwise a negative error value
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
* @privlevel public
*
- * @remarks You must not free url
- * @param[in] handle The request handle.
- * @param[out] url The url.
+ * @remarks You must not release @a url using free().
+ * @param[in] handle The request handle
+ * @param[out] url The url
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Gets refresh token.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free refresh_token
- * @param[in] handle The request handle.
- * @param[out] refresh_token The refresh token.
+ * @remarks You must not release @a refresh_token using free().
+ * @param[in] handle The request handle
+ * @param[out] refresh_token The refresh token
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Gets response type.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
* @remarks You must not free response_type
- * @param[in] handle The request handle.
- * @param[out] response_type The respose type.
+ * @param[in] handle The request handle
+ * @param[out] response_type The respose type
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Gets client id.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free client_id
- * @param[in] handle The request handle.
- * @param[out] client_id The client id.
+ * @remarks You must not release @a client_id using free().
+ * @param[in] handle The request handle
+ * @param[out] client_id The client id
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Gets client secret.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free client_secret
- * @param[in] handle The request handle.
- * @param[out] client_secret The client_secret.
+ * @remarks You must not release @a client_secret using free().
+ * @param[in] handle The request handle
+ * @param[out] client_secret The client_secret
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Gets scope.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free scope
- * @param[in] handle The request handle.
- * @param[out] scope The scope.
+ * @remarks You must not release @a scope using free().
+ * @param[in] handle The request handle
+ * @param[out] scope The scope
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Gets state.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free state
- * @param[in] handle The request handle.
- * @param[out] state The state.
+ * @remarks You must not release @a state using free().
+ * @param[in] handle The request handle
+ * @param[out] state The state
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Gets grant type.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free grant_type
- * @param[in] handle The request handle.
- * @param[out] grant_type The grant type.
+ * @remarks You must not release @a grant_type using free().
+ * @param[in] handle The request handle
+ * @param[out] grant_type The grant type
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Gets authorization code.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free code
+ * @remarks You must not release @a code using free().
* @param[in] handle The request handle.
* @param[out] code The code.
*
/**
* @brief Gets user name.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free user_name
- * @param[in] handle The request handle.
- * @param[out] user_name The user name.
+ * @remarks You must not release @a user_name using free().
+ * @param[in] handle The request handle
+ * @param[out] user_name The user name
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Gets password.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free password
- * @param[in] handle The request handle.
- * @param[out] password The password.
+ * @remarks You must not release @a password using free().
+ * @param[in] handle The request handle
+ * @param[out] password The password
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Gets the custom value.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free custom_value
- * @param[in] handle The request handle.
- * @param[in] custom_key The custom key.
- * @param[out] custom_value The custom value.
+ * @remarks You must not release @a custom_value using free().
+ * @param[in] handle The request handle
+ * @param[in] custom_key The custom key
+ * @param[out] custom_value The custom value
*
* @return @c 0 on success,
* otherwise a negative error value
*/
OAUTH2_API int oauth2_request_get_custom_data(oauth2_request_h handle, const char *custom_key, char **custom_value);
-/* End of OAuth 2.0 APIs */
/**
* @}
*/
+#ifdef __cplusplus
+}
+#endif
+
#endif /* OAUTH2_REQUEST_H_ */
#define OAUTH2_RESPONSE_H_
#include <bundle.h>
-#include "oauth2_types.h"
-#include "oauth2_error.h"
+#include <oauth2_types.h>
+#include <oauth2_error.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
/**
* @file oauth2_response.h
typedef struct oauth2_response_s *oauth2_response_h;
/**
- * @brief Destroys the received oauth2_response_h handle.
+ * @brief Destroys the received handle.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @param[in] handle The response handle.
+ * @param[in] handle The response handle
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Gets the authorization code.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free code
- * @param[in] handle The response handle.
+ * @remarks You must not release @a code using free().
+ * @param[in] handle The response handle
* @param[out] code The code.
*
* @return @c 0 on success,
/**
* @brief Gets state.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free state
- * @param[in] handle The response handle.
+ * @remarks You must not release @a state using free().
+ * @param[in] handle The response handle
* @param[out] state The state.
*
* @return @c 0 on success,
/**
* @brief Gets access token.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free access_token
- * @param[in] handle The response handle.
- * @param[out] access_token The access token.
+ * @remarks You must not release @a access_token using free().
+ * @param[in] handle The response handle
+ * @param[out] access_token The access token
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Gets token type.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free token_type
- * @param[in] handle The response handle.
- * @param[out] token_type The token type.
+ * @remarks You must not release @a token_type using free().
+ * @param[in] handle The response handle
+ * @param[out] token_type The token type
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Gets expiry time.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free expires_in
- * @param[in] handle The response handle.
- * @param[out] expires_in Expiry value.
+ * @remarks You must not release @a expires_in using free().
+ * @param[in] handle The response handle
+ * @param[out] expires_in Expiry value
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Gets refresh token.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free refresh_token
- * @param[in] handle The response handle.
- * @param[out] refresh_token The refresh token.
+ * @remarks You must not release @a refresh_token using free().
+ * @param[in] handle The response handle
+ * @param[out] refresh_token The refresh token
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Gets scope.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free scope
- * @param[in] handle The response handle.
- * @param[out] scope The scope.
+ * @remarks You must not release @a scope using free().
+ * @param[in] handle The response handle
+ * @param[out] scope The scope
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Gets error.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free error
- * @param[in] handle The response handle.
- * @param[out] error The error structure.
+ * @remarks You must not release @a error using free().
+ * @param[in] handle The response handle
+ * @param[out] error The error structure
*
* @return @c 0 on success,
* otherwise a negative error value
* @retval #OAUTH2_ERROR_VALUE_NOT_FOUND Value not found
*
* @see oauth2_error_h
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
*/
OAUTH2_API int oauth2_response_get_error(oauth2_response_h handle, oauth2_error_h *error);
* @brief Gets the custom data.
* @details 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_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privlevel public
*
- * @remarks You must not free custom_value
- * @param[in] handle The response handle.
- * @param[in] custom_key The custom key.
- * @param[out] custom_value The custom value.
+ * @remarks You must not release @a custom_value using free().
+ * @param[in] handle The response handle
+ * @param[in] custom_key The custom key
+ * @param[out] custom_value The custom value
*
* @return @c 0 on success,
* otherwise a negative error value
*/
OAUTH2_API int oauth2_response_get_custom_data(oauth2_response_h handle, const char *custom_key, char **custom_value);
-/* End of OAuth 2.0 APIs */
/**
* @}
*/
+#ifdef __cplusplus
+}
+#endif
+
#endif /* OAUTH2_RESPONSE_H_ */
#include <tizen_error.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* @file oauth2_types.h
* @brief This file defines common types and enums of OAuth 2.0.
* @brief Enumerations for Client authentication scheme, used to sign client id and client secret accordingly.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
* @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 (http://tools.ietf.org/html/rfc2617#section-2)
+ * Default is #OAUTH2_CLIENT_AUTHENTICATION_TYPE_BASIC (<a href="http://tools.ietf.org/html/rfc2617#section-2">rfc2617#section-2</a>)
*
* @see oauth2_request_set_client_authentication_type()
*/
typedef enum {
- OAUTH2_CLIENT_AUTHENTICATION_TYPE_BASIC,/**< HTTP Basic Authentication for client authentication.**/
- OAUTH2_CLIENT_AUTHENTICATION_TYPE_DIGEST,/**< HTTP Digest Authentication for client authentication.**/
- OAUTH2_CLIENT_AUTHENTICATION_TYPE_REQUEST_BODY/**< Client credentials are sent via request body**/
+ OAUTH2_CLIENT_AUTHENTICATION_TYPE_BASIC,/**< HTTP Basic Authentication for client authentication. */
+ OAUTH2_CLIENT_AUTHENTICATION_TYPE_DIGEST,/**< HTTP Digest Authentication for client authentication. */
+ OAUTH2_CLIENT_AUTHENTICATION_TYPE_REQUEST_BODY/**< Client credentials are sent via request body */
}oauth2_client_authentication_type_e;
/**
* @see oauth2_request_set_grant_type()
*/
typedef enum {
- OAUTH2_GRANT_TYPE_AUTH_CODE, /**< Access Token Request for Authorization Code Grant type.**/
- OAUTH2_GRANT_TYPE_PASSWORD, /**< Access Token Request for Resource Owner Password Credentials Grant type.**/
- OAUTH2_GRANT_TYPE_CLIENT_CREDENTIALS, /**< Access Token Request for Client Credentials Grant type.**/
- OAUTH2_GRANT_TYPE_REFRESH /**< Refresh Token Request.**/
+ OAUTH2_GRANT_TYPE_AUTH_CODE, /**< Access Token Request for Authorization Code Grant type. */
+ OAUTH2_GRANT_TYPE_PASSWORD, /**< Access Token Request for Resource Owner Password Credentials Grant type. */
+ OAUTH2_GRANT_TYPE_CLIENT_CREDENTIALS, /**< Access Token Request for Client Credentials Grant type. */
+ OAUTH2_GRANT_TYPE_REFRESH /**< Refresh Token Request. */
}oauth2_grant_type_e;
/**
* @see oauth2_request_set_response_type()
*/
typedef enum {
- OAUTH2_RESPONSE_TYPE_CODE,/**< Requesting an authorization code as response type.**/
- OAUTH2_RESPONSE_TYPE_TOKEN/**< Requesting an access token(implicit grant) as response type.**/
+ OAUTH2_RESPONSE_TYPE_CODE,/**< Requesting an authorization code as response type. */
+ OAUTH2_RESPONSE_TYPE_TOKEN/**< Requesting an access token(implicit grant) as response type. */
}oauth2_response_type_e;
/**
- * @brief Enumerations of error codes for oauth2 APIs.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ * @brief Enumerations of error codes for oauth2 APIs.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
*/
typedef enum {
OAUTH2_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
OAUTH2_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
OAUTH2_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
-
OAUTH2_ERROR_ALREADY_IN_PROGRESS = TIZEN_ERROR_ALREADY_IN_PROGRESS, /**< Operation already in progress */
OAUTH2_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Operation not supported */
OAUTH2_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
OAUTH2_ERROR_NETWORK_ERROR = TIZEN_ERROR_ACCOUNT_OAUTH | 0x02, /**< Network error */
OAUTH2_ERROR_SERVER = TIZEN_ERROR_ACCOUNT_OAUTH | 0x03, /**< Server error */
OAUTH2_ERROR_USER_CANCELLED = TIZEN_ERROR_ACCOUNT_OAUTH | 0x04, /**< User cancelled the operation */
-
OAUTH2_ERROR_VALUE_NOT_FOUND = TIZEN_ERROR_ACCOUNT_OAUTH | 0x05, /**< Value not found */
OAUTH2_ERROR_UNKNOWN = TIZEN_ERROR_UNKNOWN /**< Unknown error */
}oauth2_error_e;
-/* End of OAuth 2.0 APIs */
/**
* @}
*/
+#ifdef __cplusplus
+}
+#endif
+
#endif /* OAUTH2_TYPES_H_ */