From: Jeonghoon Park Date: Fri, 3 Aug 2018 05:23:08 +0000 (+0900) Subject: add project name as argument for create token X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2a3f9625c0fb906123f56608fa84c900efbb5677;p=apps%2Fnative%2Ftizen-things-daemon.git add project name as argument for create token Change-Id: I5981cf8de4465dcd4ac3ea797170781578ef5354 --- diff --git a/lib/things-service/src/things-service.c b/lib/things-service/src/things-service.c index 517b499..c5af699 100644 --- a/lib/things-service/src/things-service.c +++ b/lib/things-service/src/things-service.c @@ -64,13 +64,13 @@ static char *_get_app_id(void) return app_id; } -static char *_get_token(const char *appID) +static char *_get_token(const char *appID, const char *project) { char *checksum = NULL; char *key = NULL; - key = g_strdup_printf("%s-%u-%lld", - appID, getpid(), common_get_monotonic_coarse_time()); + key = g_strdup_printf("%s-%s-%u-%lld", + appID, project, getpid(), common_get_monotonic_coarse_time()); checksum = g_compute_checksum_for_string(G_CHECKSUM_MD5, key, -1); g_free(key); @@ -264,7 +264,7 @@ int things_service_init(ts_handle *handle, const char *project) } _D("libthings_service with - project[%s], app[%s]", _handle->app_id); - _handle->token = _get_token(_handle->app_id); + _handle->token = _get_token(_handle->app_id, project); if (!_handle->token) { _E("failed to get token"); _ts_handle_free(_handle);