4 * Copyright (c) 2014 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this oauth1 except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #ifndef __SERVICE_AUTH_H__
21 #define __SERVICE_AUTH_H__
24 #define API __attribute__ ((visibility("default")))
32 #include "sal_service_adaptor.h"
33 #include "sal_service_task.h"
35 #define SERVICE_AUTH_OAUTH1_0_GET_ACCESS_TOKEN_URI "http://tizen.org/service-adaptor/auth/oauth1.0/get_access_token"
36 #define SERVICE_AUTH_OAUTH1_0_GET_EXTRA_DATA_URI "http://tizen.org/service-adaptor/auth/oauth1.0/get_extra_data"
38 #define SERVICE_AUTH_OAUTH2_0_GET_ACCESS_TOKEN_URI "http://tizen.org/service-adaptor/auth/oauth2.0/get_access_token"
39 #define SERVICE_AUTH_OAUTH2_0_GET_EXTRA_DATA_URI "http://tizen.org/service-adaptor/auth/oauth2.0/get_extra_data"
41 typedef struct _service_auth_oauth1_s *service_auth_oauth1_h;
43 typedef void (*service_auth_oauth1_cb)(int result, service_auth_oauth1_h oauth1, void *user_data);
44 typedef void (*service_auth_oauth1_get_access_token_cb)(int result, const char *access_token, void *user_data);
46 /*==================================================================================================
48 ==================================================================================================*/
50 int service_auth_oauth1_create(service_plugin_h plugin, service_auth_oauth1_h *oauth1);
51 int service_auth_oauth1_clone(service_auth_oauth1_h src_oauth1, service_auth_oauth1_h *dst_oauth1);
52 int service_auth_oauth1_destroy(service_auth_oauth1_h oauth1);
53 int service_auth_oauth1_set_callback(service_auth_oauth1_h oauth1, service_auth_oauth1_cb callback, void *user_data);
54 int service_auth_oauth1_unset_callback(service_auth_oauth1_h oauth1);
55 int service_auth_oauth1_set_access_token(service_auth_oauth1_h oauth1, const char *access_token);
56 int service_auth_oauth1_get_access_token(service_auth_oauth1_h oauth1, char **access_token);
57 int service_auth_oauth1_set_operation(service_auth_oauth1_h oauth1, const char *operation);
58 int service_auth_oauth1_get_operation(service_auth_oauth1_h oauth1, char **operation);
59 int service_auth_oauth1_create_task(service_auth_oauth1_h oauth1, service_task_h *task);
60 int service_auth_oauth1_destroy_task(service_task_h task);
66 #endif /* __SERVICE_AUTH_H__ */