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 file 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 __AUTH_PLUGIN_CLIENT_H__
21 #define __AUTH_PLUGIN_CLIENT_H__
24 #define API __attribute__ ((visibility("default")))
34 #include "service_adaptor_errors.h"
36 #define OAUTH1_0_ACCESS_TOKEN_KEY "access_token"
38 #define OAUTH1_0_GET_ACCESS_TOKEN_URI "http://tizen.org/service-adaptor/auth/oauth1.0/get_access_token"
39 #define OAUTH1_0_GET_EXTRA_DATA_URI "http://tizen.org/service-adaptor/auth/oauth1.0/get_extra_data"
41 #define OAUTH2_0_GET_ACCESS_TOKEN_URI "http://tizen.org/service-adaptor/auth/oauth2.0/get_access_token"
42 #define OAUTH2_0_GET_EXTRA_DATA_URI "http://tizen.org/service-adaptor/auth/oauth2.0/get_extra_data"
45 * @brief Describes infromation about Auth Plugin Handle
47 typedef struct _auth_provider_s
50 service_adaptor_error_e (*oauth1_get_access_token)(char **access_token);
51 service_adaptor_error_e (*oauth1_get_extra_data)(const char *key, char **value);
54 service_adaptor_error_e (*oauth2_get_access_token)(char **access_token);
55 service_adaptor_error_e (*oauth2_get_extra_data)(const char *key, char **value);
57 typedef struct _auth_provider_s *auth_provider_h;
59 int auth_provider_create(auth_provider_h *provider);
60 app_control_h auth_provider_message(auth_provider_h provider, const char *operation, void *user_data);
61 int auth_provider_add_extra_data(auth_provider_h provider, app_control_h reply);
67 #endif /* __AUTH_PLUGIN_CLIENT_H__ */