Add 3.0 APIs and sync APIs same as 2.4
[platform/core/convergence/service-adaptor.git] / client / sal_service_auth.h
1 /*
2  * Service Auth
3  *
4  * Copyright (c) 2014 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
5  *
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
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
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.
17  *
18  */
19
20 #ifndef __SERVICE_AUTH_H__
21 #define __SERVICE_AUTH_H__
22
23 #ifndef API
24 #define API __attribute__ ((visibility("default")))
25 #endif
26
27 #ifdef __cplusplus
28 extern "C"
29 {
30 #endif
31
32 #include "sal_service_adaptor.h"
33 #include "sal_service_task.h"
34
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"
37
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"
40
41 typedef struct _service_auth_oauth1_s *service_auth_oauth1_h;
42
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);
45
46 /*==================================================================================================
47                                          FUNCTION PROTOTYPES
48 ==================================================================================================*/
49
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);
61
62 #ifdef __cplusplus
63 }
64 #endif
65
66 #endif /* __SERVICE_AUTH_H__ */