From: sajal.j Date: Tue, 28 Jun 2016 11:04:44 +0000 (+0530) Subject: Deleted TC and sample X-Git-Tag: accepted/tizen/common/20160703.183615^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F72%2F77072%2F1;p=platform%2Fcore%2Faccount%2Fliboauth2.git Deleted TC and sample Signed-off-by: sajal.j Change-Id: I9dfe0b2292a5db778e93d1605b839af2bc68eeca --- diff --git a/TC/utc-oauth2.c b/TC/utc-oauth2.c deleted file mode 100644 index 4755885..0000000 --- a/TC/utc-oauth2.c +++ /dev/null @@ -1,1191 +0,0 @@ -#include "assert.h" -#include -#include - -#define OAUTH2_FREE(ptr) \ - if (ptr != NULL) { \ - free(ptr); \ - ptr = NULL; \ - } - -static bool manager_created = false; -static bool request_created = false; -static oauth2_manager_h manager = NULL; -static oauth2_request_h request = NULL; -static int _is_fail = true; - -void utc_oauth2_startup(void) -{ - int ret = OAUTH2_ERROR_NONE; - ret = oauth2_manager_create(&manager); - if (ret == OAUTH2_ERROR_NONE) - manager_created = true; - - ret = oauth2_request_create(&request); - if (ret == OAUTH2_ERROR_NONE) - request_created = true; -} - -void utc_oauth2_cleanup(void) -{ - int ret = OAUTH2_ERROR_NONE; - ret = oauth2_manager_destroy(manager); - if (ret == OAUTH2_ERROR_NONE) - manager_created = false; - - manager = NULL; - - ret = oauth2_request_destroy(request); - if (ret == OAUTH2_ERROR_NONE) - request_created = false; - - request = NULL; -} - -int utc_oauth2_manager_create_p(void) -{ - assert(manager_created); - - return 0; -} - -int utc_oauth2_manager_create_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - ret = oauth2_manager_create(NULL); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_manager_destroy_p(void) -{ - oauth2_manager_h manager_local = NULL; - - int ret = oauth2_manager_create(&manager_local); - assert_eq(ret, OAUTH2_ERROR_NONE); - - ret = oauth2_manager_destroy(manager_local); - assert_eq(ret, OAUTH2_ERROR_NONE); - - return 0; -} - -int oauth2_manager_destroy_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - ret = oauth2_manager_destroy(NULL); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_manager_request_token_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_manager_request_token(NULL, NULL, NULL, NULL); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_manager_request_authorization_grant_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_manager_request_authorization_grant(NULL, NULL, NULL, NULL); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_manager_request_access_token_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_manager_request_access_token(NULL, NULL, NULL, NULL); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_manager_refresh_access_token_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_manager_refresh_access_token(NULL, NULL, NULL, NULL); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_manager_is_request_in_progress_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_manager_is_request_in_progress(NULL); - assert_eq(ret, false); - - return 0; -} - -int oauth2_manager_clear_cookies_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_manager_clear_cookies(NULL); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_manager_clear_cache_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_manager_clear_cache(NULL); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - - -/* - * request - */ - -int oauth2_request_create_p(void) -{ - assert(request_created); - - return 0; -} - -int oauth2_request_create_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - ret = oauth2_request_create(NULL); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_destroy_p(void) -{ - assert(request_created); - utc_oauth2_cleanup(); - - assert(!request_created); - - utc_oauth2_startup(); - - return 0; -} - -int oauth2_request_destroy_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - ret = oauth2_request_destroy(NULL); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_set_auth_end_point_url_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_auth_end_point_url(request, "www.example.com"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - return 0; -} - -int oauth2_request_set_auth_end_point_url_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_auth_end_point_url(NULL, "www.example.com"); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_set_token_end_point_url_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_token_end_point_url(request, "www.example.com"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - return 0; -} - -int oauth2_request_set_token_end_point_url_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_token_end_point_url(NULL, "www.example.com"); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_set_redirection_url_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_redirection_url(request, "www.example.com"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - return 0; -} - -int oauth2_request_set_redirection_url_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_redirection_url(NULL, "www.example.com"); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_set_refresh_token_url_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_refresh_token_url(request, "www.example.com"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - return 0; -} - -int oauth2_request_set_refresh_token_url_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_refresh_token_url(NULL, "www.example.com"); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_set_refresh_token_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_refresh_token(request, "refresh_token"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - return 0; -} - -int oauth2_request_set_refresh_token_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_refresh_token(NULL, "refresh_token"); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_set_response_type_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - oauth2_response_type_e type = OAUTH2_RESPONSE_TYPE_CODE; - - ret = oauth2_request_set_response_type(request, type); - assert_eq(ret, OAUTH2_ERROR_NONE); - - return 0; -} - -int oauth2_request_set_response_type_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_response_type(NULL, OAUTH2_RESPONSE_TYPE_CODE); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_set_client_id_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_client_id(request, "client_id"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - return 0; -} - -int oauth2_request_set_client_id_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_client_id(NULL, "client_id"); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_set_client_authentication_type_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_client_authentication_type(request, OAUTH2_CLIENT_AUTHENTICATION_TYPE_REQUEST_BODY); - assert_eq(ret, OAUTH2_ERROR_NONE); - - return 0; -} - -int oauth2_request_set_client_authentication_type_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_client_authentication_type(NULL, OAUTH2_CLIENT_AUTHENTICATION_TYPE_REQUEST_BODY); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_set_scope_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_scope(request, "email"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - return 0; -} - -int oauth2_request_set_scope_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_scope(NULL, "email"); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_set_state_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_state(request, "sample_state"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - return 0; -} - -int oauth2_request_set_state_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_state(NULL, "sample_state"); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_set_grant_type_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - int type = OAUTH2_GRANT_TYPE_AUTH_CODE; - - ret = oauth2_request_set_grant_type(request, type); - assert_eq(ret, OAUTH2_ERROR_NONE); - - return 0; -} - -int oauth2_request_set_grant_type_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - int type = OAUTH2_GRANT_TYPE_AUTH_CODE; - - ret = oauth2_request_set_grant_type(NULL, type); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_set_authorization_code_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_authorization_code(request, "authorization_code"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - return 0; -} - -int oauth2_request_set_authorization_code_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_authorization_code(NULL, "authorization_code"); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_set_user_name_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_user_name(request, "user_name"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - return 0; -} - -int oauth2_request_set_user_name_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_user_name(NULL, "user_name"); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_set_password_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_password(request, "password"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - return 0; -} - -int oauth2_request_set_password_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_password(NULL, "password"); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_add_custom_data_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_add_custom_data(request, "custom_key", "custom_value"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - return 0; -} - -int oauth2_request_add_custom_data_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_add_custom_data(NULL, "custom_key", "custom_value"); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_get_auth_end_point_url_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_auth_end_point_url(request, "www.example.com"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - char *url = NULL; - ret = oauth2_request_get_auth_end_point_url(request, &url); - assert_eq(ret, OAUTH2_ERROR_NONE); - - assert_eq(strcmp("www.example.com", url), 0); - - return 0; -} - -int oauth2_request_get_auth_end_point_url_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - char *url = NULL; - - ret = oauth2_request_get_auth_end_point_url(NULL, &url); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_get_token_end_point_url_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_token_end_point_url(request, "www.example.com"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - char *url = NULL; - ret = oauth2_request_get_token_end_point_url(request, &url); - assert_eq(ret, OAUTH2_ERROR_NONE); - - assert_eq(strcmp("www.example.com", url), 0); - - return 0; -} - -int oauth2_request_get_token_end_point_url_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - char *url = NULL; - - ret = oauth2_request_get_token_end_point_url(NULL, &url); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_get_redirection_url_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_redirection_url(request, "www.example.com"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - char *url = NULL; - ret = oauth2_request_get_redirection_url(request, &url); - assert_eq(ret, OAUTH2_ERROR_NONE); - - assert_eq(strcmp("www.example.com", url), 0); - - return 0; -} - -int oauth2_request_get_redirection_url_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - char *url = NULL; - - ret = oauth2_request_get_redirection_url(NULL, &url); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_get_refresh_token_url_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_refresh_token_url(request, "www.example.com"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - char *url = NULL; - ret = oauth2_request_get_refresh_token_url(request, &url); - assert_eq(ret, OAUTH2_ERROR_NONE); - - assert_eq(strcmp("www.example.com", url), 0); - - return 0; -} - -int oauth2_request_get_refresh_token_url_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - char *url = NULL; - - ret = oauth2_request_get_refresh_token_url(NULL, &url); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_get_refresh_token_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_refresh_token(request, "refresh_token"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - char *token = NULL; - ret = oauth2_request_get_refresh_token(request, &token); - assert_eq(ret, OAUTH2_ERROR_NONE); - - assert_eq(strcmp("refresh_token", token), 0); - - return 0; -} - -int oauth2_request_get_refresh_token_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - char *token = NULL; - - ret = oauth2_request_get_refresh_token_url(NULL, &token); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_get_response_type_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - oauth2_response_type_e set_type = OAUTH2_RESPONSE_TYPE_CODE; - - ret = oauth2_request_set_response_type(request, set_type); - assert_eq(ret, OAUTH2_ERROR_NONE); - - oauth2_response_type_e type; - ret = oauth2_request_get_response_type(request, &type); - assert_eq(ret, OAUTH2_ERROR_NONE); - - assert_eq(type, OAUTH2_RESPONSE_TYPE_CODE); - - return 0; -} - -int oauth2_request_get_response_type_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - oauth2_response_type_e type; - - ret = oauth2_request_get_response_type(NULL, &type); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_get_client_id_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_client_id(request, "client_id"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - char *id = NULL; - ret = oauth2_request_get_client_id(request, &id); - assert_eq(ret, OAUTH2_ERROR_NONE); - - assert_eq(strcmp("client_id", id), 0); - - return 0; -} - -int oauth2_request_get_client_id_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - char *id = NULL; - - ret = oauth2_request_get_client_id(NULL, &id); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_get_client_secret_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_client_secret(request, "client_secret"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - char *secret = NULL; - ret = oauth2_request_get_client_secret(request, &secret); - assert_eq(ret, OAUTH2_ERROR_NONE); - - assert_eq(strcmp("client_secret", secret), 0); - - return 0; -} - -int oauth2_request_get_client_secret_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - char *secret = NULL; - - ret = oauth2_request_get_client_secret(NULL, &secret); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_get_scope_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_scope(request, "email"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - char *scope = NULL; - ret = oauth2_request_get_scope(request, &scope); - assert_eq(ret, OAUTH2_ERROR_NONE); - - assert_eq(strcmp("email", scope), 0); - - return 0; -} - -int oauth2_request_get_scope_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - char *scope = NULL; - - ret = oauth2_request_get_scope(NULL, &scope); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_get_state_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_state(request, "sample_state"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - char *state = NULL; - ret = oauth2_request_get_state(request, &state); - assert_eq(ret, OAUTH2_ERROR_NONE); - - assert_eq(strcmp("sample_state", state), 0); - - return 0; -} - -int oauth2_request_get_state_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - char *state = NULL; - - ret = oauth2_request_get_state(NULL, &state); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_get_grant_type_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - int set_type = OAUTH2_GRANT_TYPE_AUTH_CODE; - - ret = oauth2_request_set_grant_type(request, set_type); - assert_eq(ret, OAUTH2_ERROR_NONE); - - oauth2_grant_type_e type; - ret = oauth2_request_get_grant_type(request, &type); - assert_eq(ret, OAUTH2_ERROR_NONE); - - assert_eq(type, OAUTH2_GRANT_TYPE_AUTH_CODE); - - return 0; -} - -int oauth2_request_get_grant_type_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - oauth2_grant_type_e type; - - ret = oauth2_request_get_grant_type(NULL, &type); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_get_authorization_code_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_authorization_code(request, "auth_code"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - char *code = NULL; - ret = oauth2_request_get_authorization_code(request, &code); - assert_eq(ret, OAUTH2_ERROR_NONE); - - assert_eq(strcmp("auth_code", code), 0); - - return 0; -} - -int oauth2_request_get_authorization_code_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - char *code = NULL; - - ret = oauth2_request_get_authorization_code(NULL, &code); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_get_user_name_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_user_name(request, "user_name"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - char *user_name = NULL; - ret = oauth2_request_get_user_name(request, &user_name); - assert_eq(ret, OAUTH2_ERROR_NONE); - - assert_eq(strcmp("user_name", user_name), 0); - - return 0; -} - -int oauth2_request_get_user_name_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - char *user_name = NULL; - - ret = oauth2_request_get_user_name(NULL, &user_name); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_get_password_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_set_password(request, "password"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - char *password = NULL; - ret = oauth2_request_get_password(request, &password); - assert_eq(ret, OAUTH2_ERROR_NONE); - - assert_eq(strcmp("password", password), 0); - - return 0; -} - -int oauth2_request_get_password_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - char *password = NULL; - - ret = oauth2_request_get_password(NULL, &password); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_request_get_custom_data_p(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_request_add_custom_data(request, "c_key", "c_val"); - assert_eq(ret, OAUTH2_ERROR_NONE); - - char *val = NULL; - ret = oauth2_request_get_custom_data(request, "c_key", &val); - assert_eq(ret, OAUTH2_ERROR_NONE); - - assert_eq(strcmp("c_val", val), 0); - - return 0; -} - -int oauth2_request_get_custom_data_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - char *val = NULL; - ret = oauth2_request_get_custom_data(request, "key", &val); - assert_eq(ret, OAUTH2_ERROR_VALUE_NOT_FOUND); - - return 0; -} - - -/* - * response - */ - -int oauth2_response_destroy_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - - ret = oauth2_response_destroy(NULL); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_response_get_authorization_code_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - char *code = NULL; - - ret = oauth2_response_get_authorization_code(NULL, &code); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_response_get_state_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - char *state = NULL; - - ret = oauth2_response_get_state(NULL, &state); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_response_get_access_token_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - char *token = NULL; - - ret = oauth2_response_get_access_token(NULL, &token); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_response_get_token_type_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - char *type = NULL; - - ret = oauth2_response_get_token_type(NULL, &type); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_response_get_expires_in_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - long long expires_in = 0; - - ret = oauth2_response_get_expires_in(NULL, &expires_in); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_response_get_refresh_token_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - char *token = NULL; - - ret = oauth2_response_get_refresh_token(NULL, &token); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_response_get_scope_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - char *scope = NULL; - - ret = oauth2_response_get_scope(NULL, &scope); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_response_get_error_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - oauth2_error_h err = NULL; - - ret = oauth2_response_get_error(NULL, &err); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_response_get_custom_data_n(void) -{ - assert(request); - - int ret = OAUTH2_ERROR_NONE; - - char *val = NULL; - ret = oauth2_response_get_custom_data(NULL, "key", &val); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - - -/* - * error - */ - -int oauth2_error_get_code_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - - int val1 = 0; - int val2 = 0; - - ret = oauth2_error_get_code(NULL, &val1, &val2); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_error_get_description_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - char *description = NULL; - - ret = oauth2_error_get_description(NULL, &description); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_error_get_uri_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - char *uri = NULL; - - ret = oauth2_error_get_uri(NULL, &uri); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - -int oauth2_error_get_custom_data_n(void) -{ - int ret = OAUTH2_ERROR_NONE; - - char *val = NULL; - ret = oauth2_error_get_custom_data(NULL, "key", &val); - assert_eq(ret, OAUTH2_ERROR_INVALID_PARAMETER); - - return 0; -} - diff --git a/sample/oauth2sample/.cproject b/sample/oauth2sample/.cproject deleted file mode 100644 index 85f9721..0000000 --- a/sample/oauth2sample/.cproject +++ /dev/null @@ -1,496 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sample/oauth2sample/.exportMap b/sample/oauth2sample/.exportMap deleted file mode 100644 index 43e310e..0000000 --- a/sample/oauth2sample/.exportMap +++ /dev/null @@ -1,4 +0,0 @@ -{ - global: main; - local: *; -}; diff --git a/sample/oauth2sample/.gitignore b/sample/oauth2sample/.gitignore deleted file mode 100644 index 65fa71e..0000000 --- a/sample/oauth2sample/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/Debug -/SA_Report diff --git a/sample/oauth2sample/.project b/sample/oauth2sample/.project deleted file mode 100644 index 23daa08..0000000 --- a/sample/oauth2sample/.project +++ /dev/null @@ -1,43 +0,0 @@ - - - oauth2sample - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - org.tizen.nativecore.apichecker.core.builder - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.tizen.nativecore.apichecker.core.tizenCppNature - - - - 1419424840036 - - 26 - - org.eclipse.ui.ide.multiFilter - 1.0-projectRelativePath-matches-false-false-*/.tpk - - - - diff --git a/sample/oauth2sample/.rds_delta b/sample/oauth2sample/.rds_delta deleted file mode 100644 index 72a760a..0000000 --- a/sample/oauth2sample/.rds_delta +++ /dev/null @@ -1,6 +0,0 @@ -#delete -#add -#modify -author-signature.xml -signature1.xml -bin/oauth2sample diff --git a/sample/oauth2sample/.sdk_delta.info b/sample/oauth2sample/.sdk_delta.info deleted file mode 100644 index 8231060..0000000 Binary files a/sample/oauth2sample/.sdk_delta.info and /dev/null differ diff --git a/sample/oauth2sample/.sign/.manifest.tmp b/sample/oauth2sample/.sign/.manifest.tmp deleted file mode 100644 index 4b35ba8..0000000 --- a/sample/oauth2sample/.sign/.manifest.tmp +++ /dev/null @@ -1,6 +0,0 @@ -res/images/grid_image/1_raw.png__DEL__IJNLOq/2eGlWpHGmr+9Mr8bWDbnm0RohlK0cMHO8jZU= -res/images/iu.png__DEL__iLwO5Bzet3XJ6+hLP5KGoIsFcgDFFICC19Pk+JGz4is= -res/ui_controls.edj__DEL__P5tTRH+wMgYOHC4QcTJeBfVUjJNtIkZRJL9uAJsDt5o= -tizen-manifest.xml__DEL__REZ9bAErUlTAZTGWvFzxO+T0YAz2d/T684MIZ/1Ck04= -author-signature.xml__DEL__ybL4oH6K7BJTbQoOvIrx95Gw08Y4oRY5rnLe5SDS0Pg= -bin/oauth2sample__DEL__xp2KvMkshUwa7Z6YfIHytYMTIoouW3csKkKojalMoKM= diff --git a/sample/oauth2sample/.sign/author-signature.xml b/sample/oauth2sample/.sign/author-signature.xml deleted file mode 100644 index 1f27ebb..0000000 --- a/sample/oauth2sample/.sign/author-signature.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - -xp2KvMkshUwa7Z6YfIHytYMTIoouW3csKkKojalMoKM= - - - -IJNLOq/2eGlWpHGmr+9Mr8bWDbnm0RohlK0cMHO8jZU= - - - -iLwO5Bzet3XJ6+hLP5KGoIsFcgDFFICC19Pk+JGz4is= - - - -P5tTRH+wMgYOHC4QcTJeBfVUjJNtIkZRJL9uAJsDt5o= - - - -REZ9bAErUlTAZTGWvFzxO+T0YAz2d/T684MIZ/1Ck04= - - - - - - -lpo8tUDs054eLlBQXiDPVDVKfw30ZZdtkRs1jd7H5K8= - - - -dbKvWD7AESvXzx7kK3JI6yDhpf/61w/toG9DCqXWHdZImK2wRp81tlDrlprVGe73hs7gSwS+el00 -7my2EgZs6NNE7+B6U5MnE5siOsUyy+m2/ii5hIPbNhDyj4Y+cFERqg+xPsm1NEopGDKFeHUK8WKq -3w7H25JBNCeo4o+AOFo= - - - - -MIIClTCCAX2gAwIBAgIGAUrO5j0CMA0GCSqGSIb3DQEBBQUAMFYxGjAYBgNVBAoMEVRpemVuIEFz -c29jaWF0aW9uMRowGAYDVQQLDBFUaXplbiBBc3NvY2lhdGlvbjEcMBoGA1UEAwwTVGl6ZW4gRGV2 -ZWxvcGVycyBDQTAeFw0xMjExMDEwMDAwMDBaFw0xOTAxMDEwMDAwMDBaMBExDzANBgNVBAMMBmF1 -dGhvcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA2G3EqJEfw34IO14zXvcnlAqvWeh/2vZT -anRYQCrAdhZuTPF/S+Nqn2j+MLFTxvKfifv4obHV1ZUHKDfb3I0ttx84PZBMARxUyWkuZDt/166W -h/JUFHFYkuqOc6/dlrj5RcB2WpdqqExdLSqNvf9ROxyoFX+RjBmvhZtKli4dp7MCAwEAAaMyMDAw -DAYDVR0TAQH/BAIwADALBgNVHQ8EBAMCB4AwEwYDVR0lBAwwCgYIKwYBBQUHAwMwDQYJKoZIhvcN -AQEFBQADggEBAAQnep8Zk5FnQQEedDrsaqFvUgqOg22RToG/4wFJophVKDYiT2sA3kTfq2yR5nWB -EgspvIkM6y9q+eNmMxGvP7JL4nbPqFdN66UXxfd09AtFj4oWiYU2sy8Hv4DbHYa2EsHXlfyICWZw -M6OHDIVYVZiVAmkYDPnCWlZ/fpbHHPjhi7LeFgKKFA36DGnMxeB5O3B4WKzPBg+EDizQD7IKXvQj -gIlhQ468Jy5HCgNfz8OERTeYU1YjrBgcwz69gClCbdd38mYIFf6EN7yCwAGwabsGa5olU6lCY8HT -D2w0LCkiUJe0lOKN0xyPTxvcm3HNitF+v8ibRNIfQrQaETEClSk= - - -MIIDOTCCAiGgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMRowGAYDVQQKDBFUaXplbiBBc3NvY2lh -dGlvbjEaMBgGA1UECwwRVGl6ZW4gQXNzb2NpYXRpb24xHjAcBgNVBAMMFVRpemVuIERldmVsb3Bl -cnMgUm9vdDAeFw0xMjAxMDEwMDAwMDBaFw0yNzAxMDEwMDAwMDBaMFYxGjAYBgNVBAoMEVRpemVu -IEFzc29jaWF0aW9uMRowGAYDVQQLDBFUaXplbiBBc3NvY2lhdGlvbjEcMBoGA1UEAwwTVGl6ZW4g -RGV2ZWxvcGVycyBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANVGhRGmMIUyBA7o -PCz8Sxut6z6HNkF4oDIuzuKaMzRYPeWodwe9O0gmqAkToQHfwg2giRhE5GoPld0fq+OYMMwSasCu -g8dwODx1eDeSYVuOLWRxpAmbTXOsSFi6VoWeyaPEm18JBHvZBsU5YQtgZ6Kp7MqzvQg3pXOxtajj -vyHxiatJl+xXrHgcXC1wgyG3buty7u/Fi2mvKXJ0PRJcCjjK81dqe/Vr20sRUCrbk02zbm5ggFt/ -jIEhV8wbFRQpliobc7J4dSTKhFfrqGM8rdd54LYhD7gSI1CFSe16pUXfcVR7FhJztRaiGLnCrwBE -dyTZ248+D4L/qR/D0axb3jcCAwEAAaMQMA4wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOC -AQEAnOXXQ/1O/QTDHyrmQDtFziqPY3xWlJBqJtEqXiT7Y+Ljpe66e+Ee/OjQMlZe8gu21/8cKklH -95RxjopMWCVedXDUbWdvS2+CdyvVW/quT2E0tjqIzXDekUTYwwhlPWlGxvfj3VsxqSFq3p8Brl04 -1Gx5RKAGyKVsMfTLhbbwSWwApuBUxYfcNpKwLWGPXkysu+HctY03OKv4/xKBnVWiN8ex/Sgesi0M -+OBAOMdZMPK32uJBTeKFx1xZgTLIhk45V0hPOomPjZloiv0LSS11eyd451ufjW0iHRE7WlpR6EvI -W6TFyZgMpQq+kg4hWl2SBTf3s2VI8Ygz7gj8TMlClg== - - - - - \ No newline at end of file diff --git a/sample/oauth2sample/.sign/signature1.xml b/sample/oauth2sample/.sign/signature1.xml deleted file mode 100644 index c24a51b..0000000 --- a/sample/oauth2sample/.sign/signature1.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - -ybL4oH6K7BJTbQoOvIrx95Gw08Y4oRY5rnLe5SDS0Pg= - - - -xp2KvMkshUwa7Z6YfIHytYMTIoouW3csKkKojalMoKM= - - - -IJNLOq/2eGlWpHGmr+9Mr8bWDbnm0RohlK0cMHO8jZU= - - - -iLwO5Bzet3XJ6+hLP5KGoIsFcgDFFICC19Pk+JGz4is= - - - -P5tTRH+wMgYOHC4QcTJeBfVUjJNtIkZRJL9uAJsDt5o= - - - -REZ9bAErUlTAZTGWvFzxO+T0YAz2d/T684MIZ/1Ck04= - - - - - - -u/jU3U4Zm5ihTMSjKGlGYbWzDfRkGphPPHx3gJIYEJ4= - - - -ZKdD+UmX507rvD/ESshJj/4ULhik0d9822DPXsubv15lUmZsq9NgHz2pctbxs9qP2DJlfUB2GyoX -zmSDnD3rO9Woui/nZUop8vhtgqcTfrVkmSPeJxWIWRWyj4opTiJmJoyTP5x3/aDgqdPag5pPrv94 -aUDFngoHB/JxAOxxkCA= - - - - -MIICmzCCAgQCCQDXI7WLdVZwiTANBgkqhkiG9w0BAQUFADCBjzELMAkGA1UEBhMCS1IxDjAMBgNV -BAgMBVN1d29uMQ4wDAYDVQQHDAVTdXdvbjEWMBQGA1UECgwNVGl6ZW4gVGVzdCBDQTEiMCAGA1UE -CwwZVGl6ZW4gRGlzdHJpYnV0b3IgVGVzdCBDQTEkMCIGA1UEAwwbVGl6ZW4gUHVibGljIERpc3Ry -aWJ1dG9yIENBMB4XDTEyMTAyOTEzMDMwNFoXDTIyMTAyNzEzMDMwNFowgZMxCzAJBgNVBAYTAktS -MQ4wDAYDVQQIDAVTdXdvbjEOMAwGA1UEBwwFU3V3b24xFjAUBgNVBAoMDVRpemVuIFRlc3QgQ0Ex -IjAgBgNVBAsMGVRpemVuIERpc3RyaWJ1dG9yIFRlc3QgQ0ExKDAmBgNVBAMMH1RpemVuIFB1Ymxp -YyBEaXN0cmlidXRvciBTaWduZXIwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALtMvlc5hENK -90ZdA+y66+Sy0enD1gpZDBh5T9RP0oRsptJv5jjNTseQbQi0SZOdOXb6J7iQdlBCtR343RpIEz8H -mrBy7mSY7mgwoU4EPpp4CTSUeAuKcmvrNOngTp5Hv7Ngf02TTHOLK3hZLpGayaDviyNZB5PdqQdB -hokKjzAzAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAvGp1gxxAIlFfhJH1efjb9BJK/rtRkbYn9+Ez -GEbEULg1svsgnyWisFimI3uFvgI/swzr1eKVY3Sc8MQ3+Fdy3EkbDZ2+WAubhcEkorTWjzWz2fL1 -vKaYjeIsuEX6TVRUugHWudPzcEuQRLQf8ibZWjbQdBmpeQYBMg5x+xKLCJc= - - -MIICtDCCAh2gAwIBAgIJAMDbehElPNKvMA0GCSqGSIb3DQEBBQUAMIGVMQswCQYDVQQGEwJLUjEO -MAwGA1UECAwFU3V3b24xDjAMBgNVBAcMBVN1d29uMRYwFAYDVQQKDA1UaXplbiBUZXN0IENBMSMw -IQYDVQQLDBpUVGl6ZW4gRGlzdHJpYnV0b3IgVGVzdCBDQTEpMCcGA1UEAwwgVGl6ZW4gUHVibGlj -IERpc3RyaWJ1dG9yIFJvb3QgQ0EwHhcNMTIxMDI5MTMwMjUwWhcNMjIxMDI3MTMwMjUwWjCBjzEL -MAkGA1UEBhMCS1IxDjAMBgNVBAgMBVN1d29uMQ4wDAYDVQQHDAVTdXdvbjEWMBQGA1UECgwNVGl6 -ZW4gVGVzdCBDQTEiMCAGA1UECwwZVGl6ZW4gRGlzdHJpYnV0b3IgVGVzdCBDQTEkMCIGA1UEAwwb -VGl6ZW4gUHVibGljIERpc3RyaWJ1dG9yIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDe -OTS/3nXvkDEmsFCJIvRlQ3RKDcxdWJJp625pFqHdmoJBdV+x6jl1raGK2Y1sp2Gdvpjc/z92yzAp -bE/UVLPh/tRNZPeGhzU4ejDDm7kzdr2f7Ia0U98K+OoY12ucwg7TYNItj9is7Cj4blGfuMDzd2ah -2AgnCGlwNwV/pv+uVQIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBACqJ -KO33YdoGudwanZIxMdXuxnnD9R6u72ltKk1S4zPfMJJv482CRGCI4FK6djhlsI4i0Lt1SVIJEed+ -yc3qckGm19dW+4xdlkekon7pViEBWuyHw8OWv3RXtTum1+PGHjBJ2eYY4ZKIpz73U/1NC16sTB/0 -VhfnkHwPltmrpYVe - - - - - \ No newline at end of file diff --git a/sample/oauth2sample/.tproject b/sample/oauth2sample/.tproject deleted file mode 100644 index f1cc1fd..0000000 --- a/sample/oauth2sample/.tproject +++ /dev/null @@ -1,11 +0,0 @@ - - - - - mobile-2.3 - - - - - - diff --git a/sample/oauth2sample/README b/sample/oauth2sample/README deleted file mode 100644 index 574c6d3..0000000 --- a/sample/oauth2sample/README +++ /dev/null @@ -1,26 +0,0 @@ - - -Instruction to use OAuth 2.0 Sample application. - -1. On launching the application you get a list of several service providers. - -2. The service providers along with the different type of autherization grant are provided. - -3. To get the access token, example for google access token, click on the Google button, - You have to enter ur gmail credentials and it will response you with - access token, refresh token and token expering time in a pop up. - -4. For implicit grant autherization(Facebook), after we enter the - credentials we get acess token and expire time in response. - -5. For client cretential autherization grant(Twitter) we directly get - the acess token using the predefined client id and secret. - -6. For password autherization grant(Salesforce) we directly get the - acess token using the predefined client id and secret. - -7. In any time during the autherization process(code, implicit), - we can come back to main page using the hardware back button or the - cancel key and the appropriate reponse will be shown in the pop up. - -8. There is a button added in the list to clear all the cache and cookie data. diff --git a/sample/oauth2sample/edc_resource/button.edc b/sample/oauth2sample/edc_resource/button.edc deleted file mode 100644 index 2da3bfa..0000000 --- a/sample/oauth2sample/edc_resource/button.edc +++ /dev/null @@ -1,347 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#define BUTTON_PADDING_WIDTH 170 -#define BUTTON_PADDING_HEIGHT 22 - -group { name: "button_layout"; - parts { - part { name: "top_padding"; - type: SPACER; - scale: 1; - description { state: "default" 0.0; - min: BUTTON_PADDING_WIDTH BUTTON_PADDING_HEIGHT; - fixed: 0 1; - rel2.relative: 1.0 0.0; - align: 0 0; - } - } - part { name: "btn_expand_opened"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - fixed: 1 1; - align: 0.5 0; - rel1 { - relative: 0.5 1.0; - to_y: "top_padding"; - } - rel2 { - relative: 0.5 1.0; - to_y: "top_padding"; - } - } - } - part { name: "btn_expand_opened_bottom_padding"; - type: SPACER; - scale: 1; - description { state: "default" 0.0; - min: BUTTON_PADDING_WIDTH BUTTON_PADDING_HEIGHT; - max: BUTTON_PADDING_WIDTH BUTTON_PADDING_HEIGHT; - fixed: 1 1; - align: 0.5 0; - rel1 { - relative: 0.0 1.0; - to_y: "btn_expand_opened"; - } - rel2.to_y: "btn_expand_opened"; - } - } - part { name: "btn_expand_closed"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - fixed: 1 1; - align: 0.5 0; - rel1 { - relative: 0.5 1.0; - to_y: "btn_expand_opened_bottom_padding"; - } - rel2 { - relative: 0.5 1.0; - to_y: "btn_expand_opened_bottom_padding"; - } - } - } - part { name: "btn_expand_closed_bottom_padding"; - type: SPACER; - scale: 1; - description { state: "default" 0.0; - min: BUTTON_PADDING_WIDTH BUTTON_PADDING_HEIGHT; - max: BUTTON_PADDING_WIDTH BUTTON_PADDING_HEIGHT; - fixed: 1 1; - align: 0.5 0; - rel1 { - relative: 0 1.0; - to_y: "btn_expand_closed"; - } - rel2.to_y: "btn_expand_closed"; - } - } - part { name: "btn_reorder"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - fixed: 1 1; - align: 0.5 0; - rel1 { - relative: 0.5 1.0; - to_y: "btn_expand_closed_bottom_padding"; - } - rel2 { - relative: 0.5 1.0; - to_y: "btn_expand_closed_bottom_padding"; - } - } - } - part { name: "btn_reorder_bottom_padding"; - type: SPACER; - scale: 1; - description { state: "default" 0.0; - min: BUTTON_PADDING_WIDTH BUTTON_PADDING_HEIGHT; - max: BUTTON_PADDING_WIDTH BUTTON_PADDING_HEIGHT; - fixed: 1 1; - align: 0.5 0; - rel1 { - relative: 0.0 1.0; - to_y: "btn_reorder"; - } - rel2.to_y: "btn_reorder"; - } - } - part { name: "btn_expand_add"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - fixed: 1 1; - align: 0.5 0; - rel1 { - relative: 0.5 1.0; - to_y: "btn_reorder_bottom_padding"; - } - rel2 { - relative: 0.5 1.0; - to_y: "btn_reorder_bottom_padding"; - } - } - } - part { name: "btn_expand_add_bottom_padding"; - type: SPACER; - scale: 1; - description { state: "default" 0.0; - min: BUTTON_PADDING_WIDTH BUTTON_PADDING_HEIGHT; - max: BUTTON_PADDING_WIDTH BUTTON_PADDING_HEIGHT; - fixed: 1 1; - align: 0.5 0; - rel1 { - relative: 0.0 1.0; - to_y: "btn_expand_add"; - } - rel2.to_y: "btn_expand_add"; - } - } - part { name: "btn_expand_delete"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - fixed: 1 1; - align: 0.5 0; - rel1 { - relative: 0.5 1.0; - to_y: "btn_expand_add_bottom_padding"; - } - rel2 { - relative: 0.5 1.0; - to_y: "btn_expand_add_bottom_padding"; - } - } - } - part { name: "btn_expand_delete_bottom_padding"; - type: SPACER; - scale: 1; - description { state: "default" 0.0; - min: BUTTON_PADDING_WIDTH BUTTON_PADDING_HEIGHT; - max: BUTTON_PADDING_WIDTH BUTTON_PADDING_HEIGHT; - fixed: 1 1; - align: 0.5 0; - rel1 { - relative: 0.0 1.0; - to_y: "btn_expand_delete"; - } - rel2.to_y: "btn_expand_delete"; - } - } - part { name: "btn_default"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - fixed: 1 1; - align: 0.5 0; - rel1 { - relative: 0.5 1.0; - to_y: "btn_expand_delete_bottom_padding"; - } - rel2 { - relative: 0.5 1.0; - to_y: "btn_expand_delete_bottom_padding"; - } - } - } - part { name: "btn_default_bottom_padding"; - type: SPACER; - scale: 1; - description { state: "default" 0.0; - min: BUTTON_PADDING_WIDTH BUTTON_PADDING_HEIGHT; - max: BUTTON_PADDING_WIDTH BUTTON_PADDING_HEIGHT; - fixed: 1 1; - align: 0.5 0; - rel1 { - relative: 0.0 1.0; - to_y: "btn_default"; - } - rel2.to_y: "btn_default"; - } - } - part { name: "btn_circle"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - fixed: 1 1; - align: 0.5 0; - rel1 { - relative: 0.5 1.0; - to_y: "btn_default_bottom_padding"; - } - rel2 { - relative: 0.5 1.0; - to_y: "btn_default_bottom_padding"; - } - } - } - part { name: "btn_circle_bottom_padding"; - type: SPACER; - scale: 1; - description { state: "default" 0.0; - min: BUTTON_PADDING_WIDTH BUTTON_PADDING_HEIGHT; - max: BUTTON_PADDING_WIDTH BUTTON_PADDING_HEIGHT; - fixed: 1 1; - align: 0.5 0; - rel1 { - relative: 0.0 1.0; - to_y: "btn_circle"; - } - rel2.to_y: "btn_circle"; - } - } - part { name: "btn_bottom"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - fixed: 1 1; - state: "default" 0.0; - align: 0.5 0; - rel1 { - relative: 0.5 1.0; - to_y: "btn_circle_bottom_padding"; - } - rel2 { - relative: 0.5 1.0; - to_y: "btn_circle_bottom_padding"; - } - } - } - part { name: "btn_bottom_padding"; - type: SPACER; - scale: 1; - description { state: "default" 0.0; - min: BUTTON_PADDING_WIDTH BUTTON_PADDING_HEIGHT; - max: BUTTON_PADDING_WIDTH BUTTON_PADDING_HEIGHT; - fixed: 1 1; - align: 0.5 0; - rel1 { - relative: 0.0 1.0; - to_y: "btn_bottom"; - } - rel2.to_y: "btn_bottom"; - } - } - part { name: "btn_circle_text"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - fixed: 1 1; - state: "default" 0.0; - align: 0.5 0; - rel1 { - relative: 0.5 1.0; - to_y: "btn_bottom_padding"; - } - rel2 { - relative: 0.5 1.0; - to_y: "btn_bottom_padding"; - } - } - } - part { name: "btn_circle_text_padding"; - type: SPACER; - scale: 1; - description { state: "default" 0.0; - min: BUTTON_PADDING_WIDTH BUTTON_PADDING_HEIGHT; - max: BUTTON_PADDING_WIDTH BUTTON_PADDING_HEIGHT; - fixed: 1 1; - align: 0.5 0; - rel1 { - relative: 0.0 1.0; - to_y: "btn_circle_text"; - } - rel2.to_y: "btn_circle_text"; - } - } - part { name: "btn_contacts"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - fixed: 1 1; - state: "default" 0.0; - align: 0.5 0; - rel1 { - relative: 0.5 1.0; - to_y: "btn_circle_text_padding"; - } - rel2 { - relative: 0.5 1.0; - to_y: "btn_circle_text_padding"; - } - } - } - part { name: "bottom_padding"; - type: SPACER; - scale: 1; - description { state: "default" 0.0; - min: 0 BUTTON_PADDING_HEIGHT; - align: 0.5 1.0; - rel1 { - relative: 0.0 1.0; - to_y: "btn_contacts"; - } - } - } - } -} - -#undef BUTTON_PADDING_WIDTH -#undef BUTTON_PADDING_HEIGHT diff --git a/sample/oauth2sample/edje/images/00_controlbar_icon_artists.png b/sample/oauth2sample/edje/images/00_controlbar_icon_artists.png deleted file mode 100644 index 85dd55c..0000000 Binary files a/sample/oauth2sample/edje/images/00_controlbar_icon_artists.png and /dev/null differ diff --git a/sample/oauth2sample/edje/images/00_controlbar_icon_dialer.png b/sample/oauth2sample/edje/images/00_controlbar_icon_dialer.png deleted file mode 100644 index 5dbb9fe..0000000 Binary files a/sample/oauth2sample/edje/images/00_controlbar_icon_dialer.png and /dev/null differ diff --git a/sample/oauth2sample/edje/images/00_controlbar_icon_favorites.png b/sample/oauth2sample/edje/images/00_controlbar_icon_favorites.png deleted file mode 100644 index 663b6fa..0000000 Binary files a/sample/oauth2sample/edje/images/00_controlbar_icon_favorites.png and /dev/null differ diff --git a/sample/oauth2sample/edje/images/00_controlbar_icon_playlist.png b/sample/oauth2sample/edje/images/00_controlbar_icon_playlist.png deleted file mode 100644 index cb77f2b..0000000 Binary files a/sample/oauth2sample/edje/images/00_controlbar_icon_playlist.png and /dev/null differ diff --git a/sample/oauth2sample/edje/images/00_controlbar_icon_songs.png b/sample/oauth2sample/edje/images/00_controlbar_icon_songs.png deleted file mode 100644 index b47daf3..0000000 Binary files a/sample/oauth2sample/edje/images/00_controlbar_icon_songs.png and /dev/null differ diff --git a/sample/oauth2sample/edje/images/core_button_add.png b/sample/oauth2sample/edje/images/core_button_add.png deleted file mode 100644 index d2b5db5..0000000 Binary files a/sample/oauth2sample/edje/images/core_button_add.png and /dev/null differ diff --git a/sample/oauth2sample/edje/images/core_button_delete.png b/sample/oauth2sample/edje/images/core_button_delete.png deleted file mode 100644 index 37d3e5f..0000000 Binary files a/sample/oauth2sample/edje/images/core_button_delete.png and /dev/null differ diff --git a/sample/oauth2sample/edje/images/core_color_picker_palette.png b/sample/oauth2sample/edje/images/core_color_picker_palette.png deleted file mode 100644 index 497cc75..0000000 Binary files a/sample/oauth2sample/edje/images/core_color_picker_palette.png and /dev/null differ diff --git a/sample/oauth2sample/edje/images/core_icon_brightness.png b/sample/oauth2sample/edje/images/core_icon_brightness.png deleted file mode 100644 index f7dfb29..0000000 Binary files a/sample/oauth2sample/edje/images/core_icon_brightness.png and /dev/null differ diff --git a/sample/oauth2sample/edje/images/grid_image/1_raw.jpg b/sample/oauth2sample/edje/images/grid_image/1_raw.jpg deleted file mode 100644 index 94deef3..0000000 Binary files a/sample/oauth2sample/edje/images/grid_image/1_raw.jpg and /dev/null differ diff --git a/sample/oauth2sample/edje/images/grid_image/2_raw.jpg b/sample/oauth2sample/edje/images/grid_image/2_raw.jpg deleted file mode 100644 index 3438b54..0000000 Binary files a/sample/oauth2sample/edje/images/grid_image/2_raw.jpg and /dev/null differ diff --git a/sample/oauth2sample/edje/images/horz_scrollbar.jpg b/sample/oauth2sample/edje/images/horz_scrollbar.jpg deleted file mode 100644 index ab27b96..0000000 Binary files a/sample/oauth2sample/edje/images/horz_scrollbar.jpg and /dev/null differ diff --git a/sample/oauth2sample/edje/images/iu.jpg b/sample/oauth2sample/edje/images/iu.jpg deleted file mode 100644 index 38586e9..0000000 Binary files a/sample/oauth2sample/edje/images/iu.jpg and /dev/null differ diff --git a/sample/oauth2sample/edje/images/logo.png b/sample/oauth2sample/edje/images/logo.png deleted file mode 100644 index f7f7b2d..0000000 Binary files a/sample/oauth2sample/edje/images/logo.png and /dev/null differ diff --git a/sample/oauth2sample/inc/main.h b/sample/oauth2sample/inc/main.h deleted file mode 100644 index 9652be4..0000000 --- a/sample/oauth2sample/inc/main.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include -#include -#include -#include - -#ifdef LOG_TAG -#undef LOG_TAG -#endif -#define LOG_TAG "oauth2sample" - -#define KEY_END "XF86Stop" - -#if !defined(PACKAGE) -#define PACKAGE "org.tizen.oauth2sample" -#endif - -#define ELM_DEMO_EDJ "/opt/usr/apps/org.tizen.oauth2sample/res/ui_controls.edj" -#define ICON_DIR "/opt/usr/apps/org.tizen.oauth2sample/res/images" - - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *layout; - Evas_Object *nf; - Evas_Object *datetime; - Evas_Object *popup; - Evas_Object *button; - struct tm saved_time; -} appdata_s; - -void ctxpopup_cb(void *data, Evas_Object *obj, void *event_info); -void colorselector_cb(void *data, Evas_Object *obj, void *event_info); -void conformant_cb(void *data, Evas_Object *obj, void *event_info); -void gengrid_cb(void *data, Evas_Object *obj, void *event_info); -void genlist_cb(void *data, Evas_Object *obj, void *event_info); -void drawer_cb(void *data, Evas_Object *obj, void *event_info); -void fastscroll_cb(void *data, Evas_Object *obj, void *event_info); -void naviframe_cb(void *data, Evas_Object *obj, void *event_info); -void toolbar_cb(void *data, Evas_Object *obj, void *event_info); -void toolbar_tab_style_cb(void *data, Evas_Object *obj, void *event_info); -void toolbar_navigation_style_cb(void *data, Evas_Object *obj, void *event_info); -void entry_cb(void *data, Evas_Object *obj, void *event_info); -void datetime_cb(void *data, Evas_Object *obj, void *event_info); -void slider_cb(void *data, Evas_Object *obj, void *event_info); -void progressbar_cb(void *data, Evas_Object *obj, void *event_info); - -void start_google_oauth_cb(void *data, Evas_Object *obj, void *event_info); -void start_fb_oauth_cb(void *data, Evas_Object *obj, void *event_info); -void start_github_oauth_cb(void *data, Evas_Object *obj, void *event_info); -void start_linkedin_oauth_cb(void *data, Evas_Object *obj, void *event_info); -void start_twitter_apponly_oauth_cb(void *data, Evas_Object *obj, void *event_info); -void start_google_refresh_token_cb(void *data, Evas_Object *obj, void *event_info); -void start_windows_oauth_cb(void *data, Evas_Object *obj, void *event_info); -void start_linkedin_oauth_code_cb(void *data, Evas_Object *obj, void *event_info); -void start_salesforce_oauth_code_cb(void *data, Evas_Object *obj, void *event_info); -void clear_cache_and_cookies_cb(void *data, Evas_Object *obj, void *event_info); - -void check_cb(void *data, Evas_Object *obj, void *event_info); -void nocontents_cb(void *data, Evas_Object *obj, void *event_info); -void radio_cb(void *data, Evas_Object *obj, void *event_info); -void pagecontrol_cb(void *data, Evas_Object *obj, void *event_info); -void pagecontrol_horizontal_cb(void *data, Evas_Object *obj, void *event_info); -void pagecontrol_horizontal_loop_cb(void *data, Evas_Object *obj, void *event_info); -void popup_cb(void *data, Evas_Object *obj, void *event_info); -void handler_cb(void *data, Evas_Object *obj, void *event_info); -void multibuttonentry_cb(void *data, Evas_Object *obj, void *event_info); -void spinner_cb(void *data, Evas_Object *obj, void *event_info); -void label_cb(void *data, Evas_Object *obj, void *event_info); -void label_text_styles_cb(void *data, Evas_Object *obj, void *event_info); -void label_linebreak_modes_cb(void *data, Evas_Object *obj, void *event_info); -void label_slide_cb(void *data, Evas_Object *obj, void *event_info); -void label_ellipsis_cb(void *data, Evas_Object *obj, void *event_info); -void label_color_styles_cb(void *data, Evas_Object *obj, void *event_info); -void notify_cb(void *data, Evas_Object *obj, void *event_info); -void bg_cb(void *data, Evas_Object *obj, void *event_info); diff --git a/sample/oauth2sample/res/images/grid_image/1_raw.png b/sample/oauth2sample/res/images/grid_image/1_raw.png deleted file mode 100644 index 435b065..0000000 Binary files a/sample/oauth2sample/res/images/grid_image/1_raw.png and /dev/null differ diff --git a/sample/oauth2sample/res/images/grid_image/2_raw.png b/sample/oauth2sample/res/images/grid_image/2_raw.png deleted file mode 100644 index 4939953..0000000 Binary files a/sample/oauth2sample/res/images/grid_image/2_raw.png and /dev/null differ diff --git a/sample/oauth2sample/res/images/iu.png b/sample/oauth2sample/res/images/iu.png deleted file mode 100644 index 3a1e2d7..0000000 Binary files a/sample/oauth2sample/res/images/iu.png and /dev/null differ diff --git a/sample/oauth2sample/res/ui_controls.edc b/sample/oauth2sample/res/ui_controls.edc deleted file mode 100644 index a6dc251..0000000 --- a/sample/oauth2sample/res/ui_controls.edc +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -collections { - base_scale: 1.8; - #include "../edc_resource/button.edc" -} - diff --git a/sample/oauth2sample/shared/res/oauth2sample.png b/sample/oauth2sample/shared/res/oauth2sample.png deleted file mode 100644 index 9765b1b..0000000 Binary files a/sample/oauth2sample/shared/res/oauth2sample.png and /dev/null differ diff --git a/sample/oauth2sample/src/main.c b/sample/oauth2sample/src/main.c deleted file mode 100644 index e560215..0000000 --- a/sample/oauth2sample/src/main.c +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include "main.h" -#include - -static void -win_delete_request_cb(void *data, Evas_Object *obj, void *event_info) -{ - /* To make your application go to background, - Call the elm_win_lower() instead - Evas_Object *win = (Evas_Object *) data; - elm_win_lower(win); */ - ui_app_exit(); -} - -static void -list_selected_cb(void *data, Evas_Object *obj, void *event_info) -{ - Elm_Object_Item *it = event_info; - elm_list_item_selected_set(it, EINA_FALSE); -} - -static Eina_Bool -naviframe_pop_cb(void *data, Elm_Object_Item *it) -{ - ui_app_exit(); - return EINA_FALSE; -} - -static void -create_list_view(appdata_s *ad) -{ - Evas_Object *list; - Evas_Object *btn; - Evas_Object *nf = ad->nf; - Elm_Object_Item *nf_it; - - /* List */ - list = elm_list_add(nf); - elm_list_mode_set(list, ELM_LIST_COMPRESS); - evas_object_smart_callback_add(list, "selected", list_selected_cb, - NULL); - - /* Main Menu Items Here */ - elm_list_item_append(list, "Google [Code]", NULL, NULL, - start_google_oauth_cb, nf); - /* Google uses code authentication grant type. [Code] [Single API] */ - - elm_list_item_append(list, "Facebook [Implicit]", NULL, NULL, - start_fb_oauth_cb, nf); - /* Facebook uses Implicit authentication grant type. [Implicit] */ - - elm_list_item_append(list, "GitHub [Code]", NULL, NULL, - start_github_oauth_cb, nf); - /* GitHub uses code authentication grant type. [Code] [Non-std] */ - - elm_list_item_append(list, "Twitter [Client Credential]", NULL, NULL, - start_twitter_apponly_oauth_cb, nf); - /* Twitter uses Client Credential authentication grant type. - * [Client Credential] - */ - - /* - * elm_list_item_append(list, "[Password] TODO", NULL, NULL, NULL, nf); - */ - /* Google uses Password authentication grant type. [Password] */ - - elm_list_item_append(list, "Google [Refresh Token]", NULL, NULL, - start_google_refresh_token_cb, nf); - /* - * Gets Google Refresh Token authentication grant type. - * [Refresh Token] - */ - - elm_list_item_append(list, "Windows Live [Code]", NULL, NULL, - start_windows_oauth_cb, nf); - /* - * Windows Live uses code authentication grant type. - * [Code] [Split API] - * */ - - elm_list_item_append(list, "LinkedIn [Code]", NULL, NULL, - start_linkedin_oauth_code_cb, nf); - /* LinkedIn uses code authentication grant type. [Code] [Split API] */ - - elm_list_item_append(list, "Salesforce [Password]", NULL, NULL, - start_salesforce_oauth_code_cb, nf); - /*SalesForce uses password authentication grant type. [Password] */ - - elm_list_item_append(list, "Clear all cache and cookie data", NULL, - NULL, clear_cache_and_cookies_cb, nf); - - elm_list_go(list); - - /* This button is set for devices which doesn't have H/W back key. */ - btn = elm_button_add(nf); - elm_object_style_set(btn, "naviframe/end_btn/default"); - nf_it = elm_naviframe_item_push(nf, "OAuth 2.0 Sample", btn, NULL, - list, NULL); - elm_naviframe_item_pop_cb_set(nf_it, naviframe_pop_cb, ad->win); -} - -static void -create_base_gui(appdata_s *ad) -{ - /* - * Widget Tree - * Window - * - conform - * - layout main - * - naviframe */ - - /* Window */ - ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE); - elm_win_conformant_set(ad->win, EINA_TRUE); - elm_win_autodel_set(ad->win, EINA_TRUE); - - if (elm_win_wm_rotation_supported_get(ad->win)) { - int rots[4] = { 0, 90, 180, 270 }; - elm_win_wm_rotation_available_rotations_set(ad->win, - (const int *)(&rots), 4); - } - - evas_object_smart_callback_add(ad->win, "delete,request", - win_delete_request_cb, NULL); - - /* Conformant */ - ad->conform = elm_conformant_add(ad->win); - evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - elm_win_resize_object_add(ad->win, ad->conform); - evas_object_show(ad->conform); - - /* Indicator */ - /* elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW); */ - - /* Base Layout */ - ad->layout = elm_layout_add(ad->conform); - evas_object_size_hint_weight_set(ad->layout, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - elm_layout_theme_set(ad->layout, "layout", "application", "default"); - evas_object_show(ad->layout); - - elm_object_content_set(ad->conform, ad->layout); - - /* Naviframe */ - ad->nf = elm_naviframe_add(ad->layout); - create_list_view(ad); - elm_object_part_content_set(ad->layout, "elm.swallow.content", ad->nf); - eext_object_event_callback_add(ad->nf, EEXT_CALLBACK_BACK, - eext_naviframe_back_cb, NULL); - eext_object_event_callback_add(ad->nf, EEXT_CALLBACK_MORE, - eext_naviframe_more_cb, NULL); - - /* Show window after base gui is set up */ - evas_object_show(ad->win); -} - -static bool -app_create(void *data) -{ - /* Hook to take necessary actions before main event loop starts - * Initialize UI resources and application's data - * If this function returns true, the main loop of application starts - * If this function returns false, the application is terminated - */ - appdata_s *ad = data; - - elm_app_base_scale_set(1.8); - create_base_gui(ad); - - return true; -} - -static void -app_control(app_control_h app_control, void *data) -{ - /* Handle the launch request. */ -} - -static void -app_pause(void *data) -{ - /* Take necessary actions when application becomes invisible. */ -} - -static void -app_resume(void *data) -{ - /* Take necessary actions when application becomes visible. */ -} - -static void -app_terminate(void *data) -{ - /* Release all resources. */ -} - -static void -ui_app_lang_changed(app_event_info_h event_info, void *user_data) -{ - /*APP_EVENT_LANGUAGE_CHANGED*/ - char *locale = NULL; - system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, - &locale); - elm_language_set(locale); - free(locale); - return; -} - -static void -ui_app_orient_changed(app_event_info_h event_info, void *user_data) -{ - /*APP_EVENT_DEVICE_ORIENTATION_CHANGED*/ - return; -} - -static void -ui_app_region_changed(app_event_info_h event_info, void *user_data) -{ - /*APP_EVENT_REGION_FORMAT_CHANGED*/ -} - -static void -ui_app_low_battery(app_event_info_h event_info, void *user_data) -{ - /*APP_EVENT_LOW_BATTERY*/ -} - -static void -ui_app_low_memory(app_event_info_h event_info, void *user_data) -{ - /*APP_EVENT_LOW_MEMORY*/ -} - -int -main(int argc, char *argv[]) -{ - appdata_s ad = {0,}; - int ret = 0; - - ui_app_lifecycle_callback_s event_callback = {0,}; - app_event_handler_h handlers[5] = {NULL, }; - - event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.pause = app_pause; - event_callback.resume = app_resume; - event_callback.app_control = app_control; - - ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], - APP_EVENT_LOW_BATTERY, ui_app_low_battery, &ad); - ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], - APP_EVENT_LOW_MEMORY, ui_app_low_memory, &ad); - ui_app_add_event_handler( - &handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], - APP_EVENT_DEVICE_ORIENTATION_CHANGED, - ui_app_orient_changed, &ad); - ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], - APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, &ad); - ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], - APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, &ad); - ui_app_remove_event_handler(handlers[APP_EVENT_LOW_MEMORY]); - - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) { - dlog_print(DLOG_ERROR, LOG_TAG, "app_main() failed. err = %d", - ret); - } - - return ret; -} diff --git a/sample/oauth2sample/src/oauth2_handler.c b/sample/oauth2sample/src/oauth2_handler.c deleted file mode 100644 index b9d2768..0000000 --- a/sample/oauth2sample/src/oauth2_handler.c +++ /dev/null @@ -1,802 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#include "main.h" - -#include - -#define GOOGLE_CLIENT_ID "53492317821.apps.googleusercontent.com" -#define GOOGLE_CLIENT_SECRET "2SEBA-F4EV9jkqzT1UGJe7Aq" - -#define WINDOWS_CLIENT_ID "0000000044139C34" -#define WINDOWS_CLIENT_SECRET "lq-od8DUGe9BrcaI9qVHM2Q9krFUNZDd" - -#define LINKEDIN_CLIENT_ID "782p0522d2ri2i" -#define LINKEDIN_CLIENT_SECRET "Ibj6HdUpZj2M4XIs" - -/* #define _THIS_PACKAGE "org.tizen.oauth2sample" - * - * #ifdef LOG_TAG - * #undef LOG_TAG - * #endif - * #define LOG_TAG _THIS_PACKAGE -*/ - -#ifndef _ERR -#define _ERR(fmt, args...) LOGE("[%s:%d] "fmt"\n", __func__, __LINE__, ##args) -#endif - -#ifndef _DBG -#define _DBG(fmt, args...) LOGD("[%s:%d] "fmt"\n", __func__, __LINE__, ##args) -#endif - -#ifndef _INFO -#define _INFO(fmt, args...) LOGI("[%s:%d] "fmt"\n", __func__, __LINE__, ##args) -#endif - -static oauth2_manager_h mgr1 = NULL; -char *google_refresh_token = NULL; -char *popStr; -Evas_Object *win_data = NULL; -int flag = 0; - -static void -popup_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info) -{ - Evas_Object *popup = data; - evas_object_del(popup); -} - -static void -create_popup(char *popup_str, void * data) -{ - Evas_Object *popup = elm_popup_add(win_data); - - if (flag == 0) - elm_object_part_text_set(popup, "title,text", "Response"); - else if (flag == 1) - elm_object_part_text_set(popup, "title,text", "Success"); - - elm_popup_content_text_wrap_type_set(popup, ELM_WRAP_MIXED); - elm_object_text_set(popup, popup_str); - - Evas_Object *btn1 = elm_button_add(popup); - elm_object_style_set(btn1, "popup"); - elm_object_text_set(btn1, "OK"); - elm_object_part_content_set(popup, "button1", btn1); - evas_object_smart_callback_add(btn1, "clicked", popup_btn_clicked_cb, - popup); - - evas_object_resize(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_move(popup, 10, 10); - - elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER); - evas_object_show(popup); - flag = 0; - return; -} - -void -bundle_cb(const char *key, const int type, const bundle_keyval_t *kv, - void *user_data) -{ - char *display_str = (char *)user_data; - - char *err_val = NULL; - size_t err_len = 0; - bundle_keyval_get_basic_val((bundle_keyval_t *)kv, (void **)&err_val, - &err_len); - if (err_val) { - strcat(display_str, key); - strcat(display_str, "="); - strcat(display_str, err_val); - strcat(display_str, ","); - } -} - -static void -btn_clicked_cb(void *data, Evas_Object *obj, void *event_info) -{ - int btn_num = (int)data; - - printf("clicked event on Button:%d\n", btn_num); -} - -static Evas_Object* -create_scroller(Evas_Object *parent) -{ - Evas_Object *scroller = elm_scroller_add(parent); - elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE); - elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, - ELM_SCROLLER_POLICY_AUTO); - evas_object_show(scroller); - - return scroller; -} - -static Evas_Object* -create_button_view(Evas_Object *parent) -{ - Evas_Object *btn, *img, *box; - - box = elm_box_add(parent); - evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_box_padding_set(box, 0, 5 * elm_config_scale_get()); - evas_object_show(box); - - /* icon_reorder style */ - btn = elm_button_add(box); - elm_object_style_set(btn, "icon_reorder"); - evas_object_smart_callback_add(btn, "clicked", btn_clicked_cb, - (void *)1); - evas_object_show(btn); - elm_box_pack_end(box, btn); - - /* icon_expand_add style */ - btn = elm_button_add(box); - elm_object_style_set(btn, "icon_expand_add"); - evas_object_smart_callback_add(btn, "clicked", btn_clicked_cb, - (void *)2); - evas_object_show(btn); - elm_box_pack_end(box, btn); - - /* icon_expand_delete style */ - btn = elm_button_add(box); - elm_object_style_set(btn, "icon_expand_delete"); - evas_object_smart_callback_add(btn, "clicked", btn_clicked_cb, - (void *)3); - evas_object_show(btn); - elm_box_pack_end(box, btn); - - /* default style */ - btn = elm_button_add(box); - elm_object_text_set(btn, "default"); - evas_object_size_hint_min_set(btn, ELM_SCALE_SIZE(150), - ELM_SCALE_SIZE(58)); - evas_object_smart_callback_add(btn, "clicked", btn_clicked_cb, - (void *)4); - evas_object_show(btn); - elm_box_pack_end(box, btn); - - /* btn_circle style */ - btn = elm_button_add(box); - elm_object_style_set(btn, "circle"); - elm_object_text_set(btn, "circle twoline"); - img = elm_image_add(btn); - elm_image_file_set(img, ICON_DIR"/core_icon_brightness.png", NULL); - elm_image_resizable_set(img, EINA_TRUE, EINA_TRUE); - elm_object_part_content_set(btn, "icon", img); - evas_object_smart_callback_add(btn, "clicked", btn_clicked_cb, - (void *)5); - evas_object_show(btn); - elm_box_pack_end(box, btn); - - /* bottom style */ - btn = elm_button_add(box); - elm_object_style_set(btn, "bottom"); - elm_object_text_set(btn, "bottom"); - evas_object_size_hint_min_set(btn, ELM_SCALE_SIZE(150), - ELM_SCALE_SIZE(58)); - evas_object_smart_callback_add(btn, "clicked", btn_clicked_cb, - (void *)6); - evas_object_show(btn); - elm_box_pack_end(box, btn); - - /* contacts style */ - btn = elm_button_add(box); - elm_object_style_set(btn, "contacts"); - elm_object_text_set(btn, "contacts"); - evas_object_smart_callback_add(btn, "clicked", btn_clicked_cb, - (void *)7); - evas_object_show(btn); - elm_box_pack_end(box, btn); - - btn = elm_button_add(box); - elm_object_style_set(btn, "option"); - evas_object_smart_callback_add(btn, "clicked", btn_clicked_cb, - (void *)8); - evas_object_show(btn); - elm_box_pack_end(box, btn); - - return box; -} - -void -token_response_cb(oauth2_response_h response, void *user_data) -{ - _INFO("token_response_cb"); - - char *acc_token = NULL; - oauth2_response_get_access_token(response, &acc_token); - - char *ref_token = NULL; - oauth2_response_get_refresh_token(response, &ref_token); - google_refresh_token = ref_token; - - long long int expires_in = 0; - oauth2_response_get_expires_in(response, &expires_in); - - char displayStr[1024] = {0,}; - if (acc_token) { - displayStr[0] = '\0'; - strcpy(displayStr, "access token= "); - strcat(displayStr, acc_token); - } else { - oauth2_error_h e_handle = NULL; - - oauth2_response_get_error(response, &e_handle); - char *error_val = NULL; - oauth2_error_get_custom_data(e_handle, "error", &error_val); - if (error_val) - strcpy(displayStr, error_val); - else { - int error_code = 0; - int platform_error_code = 0; - - oauth2_error_get_code(e_handle, &error_code, - &platform_error_code); - if (error_code != 0 || platform_error_code != 0) { - sprintf(displayStr, "Error=[%d][%d]", - error_code, platform_error_code); - } else - strcpy(displayStr, "Unknown server error"); - } - } - - if (ref_token) { - strcat(displayStr, "\r\n"); - strcat(displayStr, "refresh token = "); - strcat(displayStr, ref_token); - } - - if (expires_in != 0) { - strcat(displayStr, "\r\n"); - strcat(displayStr, "expires in= "); - char expires_str[128] = {0}; - sprintf(expires_str, "%lld", expires_in); - strcat(displayStr, expires_str); - } - - create_popup(displayStr , win_data); - return; -} - - -void -refresh_token_response_cb(oauth2_response_h response, void *user_data) -{ - _INFO("token_response_cb"); - - char *acc_token = NULL; - oauth2_response_get_access_token(response, &acc_token); - - char *ref_token = NULL; - oauth2_response_get_refresh_token(response, &ref_token); - - if (ref_token) { - oauth2_manager_h mgr = (oauth2_manager_h) user_data; - - oauth2_request_h request = NULL; - - int ret = oauth2_request_create(&request); - - ret = oauth2_request_set_refresh_token_url(request, - "https://www.googleapis.com/oauth2/v3/token"); - - ret = oauth2_request_set_refresh_token(request, ref_token); - - ret = oauth2_request_set_client_id(request, GOOGLE_CLIENT_ID); - - ret = oauth2_request_set_client_secret(request, - GOOGLE_CLIENT_SECRET); - - ret = oauth2_request_set_grant_type(request, - OAUTH2_GRANT_TYPE_REFRESH); - - ret = oauth2_request_set_client_authentication_type(request, - OAUTH2_CLIENT_AUTHENTICATION_TYPE_REQUEST_BODY); - - if (mgr && request) { - mgr1 = mgr; - - ret = oauth2_manager_refresh_access_token(mgr, request, - token_response_cb, NULL); - } - } else { - char displayStr[1024] = {0,}; - - oauth2_error_h e_handle = NULL; - - oauth2_response_get_error(response, &e_handle); - char *error_val = NULL; - oauth2_error_get_custom_data(e_handle, "error", &error_val); - if (error_val) - strcpy(displayStr, error_val); - else { - int error_code = 0; - int platform_error_code = 0; - - oauth2_error_get_code(e_handle, &error_code, - &platform_error_code); - - if (error_code != 0 || platform_error_code != 0) - sprintf(displayStr, "Error=[%d][%d]", - error_code, platform_error_code); - else { - strcpy(displayStr, "Unknown server error"); - } - } - - create_popup(displayStr , win_data); - } -} - -void -clear_cache_and_cookies_cb(void *data, Evas_Object *obj, void *event_info) -{ - win_data = (Evas_Object *) data; - - if (mgr1 != NULL) { - oauth2_manager_clear_cache(mgr1); - oauth2_manager_clear_cookies(mgr1); - - mgr1 = NULL; - - flag = 1; - - popStr = "cache and cookie data cleared!!!"; - create_popup(popStr , win_data); - return; - } -} - -void -code_access_token_cb(oauth2_response_h response, void *user_data) -{ - _INFO("auth2_access_token_cb"); - - char *acc_token = NULL; - char displayStr[1024] = {0,}; - oauth2_response_get_access_token(response, &acc_token); - if (acc_token) { - displayStr[0] = '\0'; - strcpy(displayStr, "access token= "); - strcat(displayStr, acc_token); - } else { - oauth2_error_h e_handle = NULL; - - oauth2_response_get_error(response, &e_handle); - char *error_val = NULL; - oauth2_error_get_custom_data(e_handle, "error", &error_val); - if (error_val) - strcpy(displayStr, error_val); - else { - int error_code = 0; - int platform_error_code = 0; - - oauth2_error_get_code(e_handle, &error_code, - &platform_error_code); - if (error_code != 0 || platform_error_code != 0) { - sprintf(displayStr, "Error=[%d][%d]", - error_code, platform_error_code); - } else { - strcpy(displayStr, "Unknown server error"); - } - } - } - create_popup(displayStr , win_data); -} - -void -grant_response_cb(oauth2_response_h response, void *user_data) -{ - _INFO("grant_response_cb"); - - char *auth_code = NULL; - oauth2_response_get_authorization_code(response, &auth_code); - if (auth_code) { - oauth2_manager_h mgr = NULL; - int ret = oauth2_manager_create(&mgr); - - oauth2_request_h request = (oauth2_request_h) user_data; - - ret = oauth2_request_set_authorization_code(request, auth_code); - - if (mgr && request) { - ret = oauth2_manager_request_access_token(mgr, - request, code_access_token_cb, NULL); - } - } else { - char displayStr[1024] = {0,}; - - oauth2_error_h e_handle = NULL; - - oauth2_response_get_error(response, &e_handle); - char *error_val = NULL; - oauth2_error_get_custom_data(e_handle, "error", &error_val); - if (error_val) { - strcpy(displayStr, error_val); - } else { - int error_code = 0; - int platform_error_code = 0; - - oauth2_error_get_code(e_handle, &error_code, - &platform_error_code); - if (error_code != 0 || platform_error_code != 0) { - sprintf(displayStr, "Error=[%d][%d]", - error_code, platform_error_code); - } else { - strcpy(displayStr, "Unknown server error"); - } - } - - create_popup(displayStr , win_data); - } -} - - -void -start_google_oauth_cb(void *data, Evas_Object *obj, void *event_info) -{ - win_data = (Evas_Object *) data; - - oauth2_manager_h mgr = NULL; - int ret = oauth2_manager_create(&mgr); - - oauth2_request_h request = NULL; - ret = oauth2_request_create(&request); - - ret = oauth2_request_set_auth_end_point_url(request, - "https://accounts.google.com/o/oauth2/auth"); - - ret = oauth2_request_set_token_end_point_url(request, - "https://accounts.google.com/o/oauth2/token"); - - ret = oauth2_request_set_redirection_url(request, - "https://localhost:8080"); - - ret = oauth2_request_set_client_id(request, GOOGLE_CLIENT_ID); - - ret = oauth2_request_set_client_secret(request, GOOGLE_CLIENT_SECRET); - - ret = oauth2_request_set_scope(request, "email"); - - ret = oauth2_request_set_response_type(request, - OAUTH2_RESPONSE_TYPE_CODE); - - if (mgr && request) { - mgr1 = mgr; - - ret = oauth2_manager_request_token(mgr, request, - token_response_cb, NULL); - } -} - - -void -start_fb_oauth_cb(void *data, Evas_Object *obj, void *event_info) -{ - oauth2_manager_h mgr = NULL; - int ret = oauth2_manager_create(&mgr); - - win_data = (Evas_Object *) data; - - oauth2_request_h request = NULL; - ret = oauth2_request_create(&request); - - ret = oauth2_request_set_auth_end_point_url(request, - "https://www.facebook.com/dialog/oauth"); - - ret = oauth2_request_set_redirection_url(request, - "https://developer.tizen.org"); - - ret = oauth2_request_set_client_id(request, "280875681986395"); - - ret = oauth2_request_set_scope(request, "read_stream"); - - ret = oauth2_request_set_response_type(request, - OAUTH2_RESPONSE_TYPE_TOKEN); - - if (mgr && request) { - mgr1 = mgr; - - ret = oauth2_manager_request_token(mgr, request, - token_response_cb, NULL); - } -} - - -void -start_github_oauth_cb(void *data, Evas_Object *obj, void *event_info) -{ - oauth2_manager_h mgr = NULL; - int ret = oauth2_manager_create(&mgr); - - oauth2_request_h request = NULL; - ret = oauth2_request_create(&request); - - win_data = (Evas_Object *) data; - - ret = oauth2_request_set_auth_end_point_url(request, - "https://github.com/login/oauth/authorize"); - - ret = oauth2_request_set_token_end_point_url(request, - "https://github.com/login/oauth/access_token"); - - ret = oauth2_request_set_redirection_url(request, - "https://developer.tizen.org"); - - ret = oauth2_request_set_client_id(request, "aa5ded12ececad47a22c"); - - ret = oauth2_request_set_client_secret(request, - "755806ea84c63f967b82d7fc451cf886d037f8f2"); - - int state_int = rand()%1000; - char state_str[128] = {0,}; - snprintf(state_str, 127, "%d", state_int); - ret = oauth2_request_set_state(request, state_str); - - ret = oauth2_request_set_scope(request, "user"); - ret = oauth2_request_set_response_type(request, - OAUTH2_RESPONSE_TYPE_CODE); - - if (mgr && request) { - mgr1 = mgr; - ret = oauth2_manager_request_token(mgr, request, - token_response_cb, NULL); - } -} - -void -start_google_refresh_token_cb(void *data, Evas_Object *obj, void *event_info) -{ - win_data = (Evas_Object *) data; - - oauth2_manager_h mgr = NULL; - int ret = oauth2_manager_create(&mgr); - - oauth2_request_h request = NULL; - ret = oauth2_request_create(&request); - - ret = oauth2_request_set_auth_end_point_url(request, - "https://accounts.google.com/o/oauth2/auth"); - - ret = oauth2_request_set_token_end_point_url(request, - "https://accounts.google.com/o/oauth2/token"); - - ret = oauth2_request_set_redirection_url(request, - "https://localhost:8080"); - - ret = oauth2_request_set_client_id(request, GOOGLE_CLIENT_ID); - - ret = oauth2_request_set_client_secret(request, GOOGLE_CLIENT_SECRET); - - ret = oauth2_request_set_scope(request, "email"); - - ret = oauth2_request_set_response_type(request, - OAUTH2_RESPONSE_TYPE_CODE); - - if (mgr && request) { - ret = oauth2_manager_request_token(mgr, request, - refresh_token_response_cb, mgr); - } -} - -void -start_twitter_apponly_oauth_cb(void *data, Evas_Object *obj, void *event_info) -{ - oauth2_manager_h mgr = NULL; - int ret = oauth2_manager_create(&mgr); - - oauth2_request_h request = NULL; - ret = oauth2_request_create(&request); - - win_data = (Evas_Object *) data; - - ret = oauth2_request_set_auth_end_point_url(request, - "https://api.twitter.com/oauth2/token"); - - ret = oauth2_request_set_token_end_point_url(request, - "https://api.twitter.com/oauth2/token"); - - ret = oauth2_request_set_redirection_url(request, - "https://developer.tizen.org"); - - ret = oauth2_request_set_client_id(request, "PiQeUGnE96DQxEw36rAPw"); - - ret = oauth2_request_set_client_secret(request, - "qxLHpdcAg5fCmE6b46GXO8UjDefr6H5C9jXF2SOFAE"); - - ret = oauth2_request_set_grant_type(request, - OAUTH2_GRANT_TYPE_CLIENT_CREDENTIALS); - - ret = oauth2_request_set_client_authentication_type(request, - OAUTH2_CLIENT_AUTHENTICATION_TYPE_BASIC); - - if (mgr && request) { - mgr1 = mgr; - - ret = oauth2_manager_request_token(mgr, request, - token_response_cb, NULL); - } -} - - -void -start_linkedin_oauth_cb(void *data, Evas_Object *obj, void *event_info) -{ - oauth2_manager_h mgr = NULL; - int ret = oauth2_manager_create(&mgr); - - oauth2_request_h request = NULL; - ret = oauth2_request_create(&request); - - ret = oauth2_request_set_auth_end_point_url(request, - "https://www.linkedin.com/uas/oauth2/authorization"); - - ret = oauth2_request_set_token_end_point_url(request, - "https://www.linkedin.com/uas/oauth2/accessToken"); - - ret = oauth2_request_set_redirection_url(request, - "https://developer.tizen.org"); - - ret = oauth2_request_set_client_id(request, ""); - - ret = oauth2_request_set_client_secret(request, ""); - - int state_int = rand()%1000; - char state_str[128] = {0,}; - snprintf(state_str, 127, "%d", state_int); - ret = oauth2_request_set_state(request, state_str); - - ret = oauth2_request_set_response_type(request, - OAUTH2_RESPONSE_TYPE_CODE); - - if (mgr && request) { - mgr1 = mgr; - - ret = oauth2_manager_request_token(mgr, request, - token_response_cb, NULL); - } -} - - -void -start_windows_oauth_cb(void *data, Evas_Object *obj, void *event_info) -{ - oauth2_manager_h mgr = NULL; - int ret = oauth2_manager_create(&mgr); - - oauth2_request_h request = NULL; - ret = oauth2_request_create(&request); - - win_data = (Evas_Object *) data; - - ret = oauth2_request_set_auth_end_point_url(request, - "https://login.live.com/oauth20_authorize.srf"); - - ret = oauth2_request_set_token_end_point_url(request, - "https://login.live.com/oauth20_token.srf"); - - ret = oauth2_request_set_redirection_url(request, - "https://developer.tizen.org"); - - ret = oauth2_request_set_client_id(request, WINDOWS_CLIENT_ID); - - ret = oauth2_request_set_client_secret(request, WINDOWS_CLIENT_SECRET); - - ret = oauth2_request_set_scope(request, "wl.basic"); - - ret = oauth2_request_set_grant_type(request, - OAUTH2_GRANT_TYPE_AUTH_CODE); - - ret = oauth2_request_set_response_type(request, - OAUTH2_RESPONSE_TYPE_CODE); - - if (mgr && request) { - mgr1 = mgr; - - ret = oauth2_manager_request_authorization_grant(mgr, - request, grant_response_cb, request); - } -} - - -void -start_linkedin_oauth_code_cb(void *data, Evas_Object *obj, void *event_info) -{ - oauth2_manager_h mgr = NULL; - int ret = oauth2_manager_create(&mgr); - - oauth2_request_h request = NULL; - ret = oauth2_request_create(&request); - - win_data = (Evas_Object *) data; - - ret = oauth2_request_set_auth_end_point_url(request, - "https://www.linkedin.com/uas/oauth2/authorization"); - - ret = oauth2_request_set_token_end_point_url(request, - "https://www.linkedin.com/uas/oauth2/accessToken"); - - ret = oauth2_request_set_redirection_url(request, - "https://developer.tizen.org"); - - ret = oauth2_request_set_client_id(request, LINKEDIN_CLIENT_ID); - - ret = oauth2_request_set_client_secret(request, LINKEDIN_CLIENT_SECRET); - - ret = oauth2_request_set_scope(request, "r_basicprofile"); - - ret = oauth2_request_set_state(request, "DCEEFWF45453sdffef424"); - - ret = oauth2_request_set_grant_type(request, - OAUTH2_GRANT_TYPE_AUTH_CODE); - - ret = oauth2_request_set_response_type(request, - OAUTH2_RESPONSE_TYPE_CODE); - - if (mgr && request) { - mgr1 = mgr; - - ret = oauth2_manager_request_authorization_grant(mgr, - request, grant_response_cb, request); - - } -} - -void -start_salesforce_oauth_code_cb(void *data, Evas_Object *obj, void *event_info) -{ - oauth2_manager_h mgr = NULL; - int ret = oauth2_manager_create(&mgr); - - oauth2_request_h request = NULL; - ret = oauth2_request_create(&request); - - win_data = (Evas_Object *) data; - - ret = oauth2_request_set_auth_end_point_url(request, - "https://login.salesforce.com/services/oauth2/authorize"); - - ret = oauth2_request_set_token_end_point_url(request, - "https://login.salesforce.com/services/oauth2/token"); - - ret = oauth2_request_set_redirection_url(request, - "https://developer.tizen.org"); - - ret = oauth2_request_set_client_id(request, - "3MVG9ZL0ppGP5UrCxqVnY_izjlRzW6tCeDYs64KXns0wGEgbtfqK8cWx16Y4gM3wx2htt0GuoDiQ.CkX2ZuI1"); - - ret = oauth2_request_set_client_secret(request, "3431205550072092349"); - - ret = oauth2_request_set_grant_type(request, - OAUTH2_GRANT_TYPE_PASSWORD); - - ret = oauth2_request_set_user_name(request, "sam_test1@outlook.com"); - - ret = oauth2_request_set_password(request, - "samsung@1gOeXzn5nKDGVNNQP4kJYEqNPp"); - - if (mgr && request) { - mgr1 = mgr; - - ret = oauth2_manager_request_token(mgr, request, - token_response_cb, request); - } -} diff --git a/sample/oauth2sample/tizen-manifest.xml b/sample/oauth2sample/tizen-manifest.xml deleted file mode 100644 index 3e6d531..0000000 --- a/sample/oauth2sample/tizen-manifest.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - oauth2sample.png - - - http://tizen.org/privilege/internet - -