diff --git a/app/src/main/java/com/scenera/nicesecurityapplib/BSSLoginActivity.java b/app/src/main/java/com/scenera/nicesecurityapplib/BSSLoginActivity.java index 76b04ea..20eaf78 100644 --- a/app/src/main/java/com/scenera/nicesecurityapplib/BSSLoginActivity.java +++ b/app/src/main/java/com/scenera/nicesecurityapplib/BSSLoginActivity.java @@ -344,7 +344,7 @@ private void getAppControlObject(AppSecurityObjectResponse appSecurityObject) { ServiceInterfaces.GetAppControlObjectEncrypted api = ApiClient.getClientAccount(this, "https://" + pHelper.getAppSecurityObject().getNICEASEndPoint().getNetEndPoint().getScheme().get(0).getAuthority()).create(ServiceInterfaces.GetAppControlObjectEncrypted.class); - Call call = api.getAppControlObject( + Call call = api.getAppControlObject("Bearer "+ accessToken, pHelper.getAppSecurityObject().getNICEASEndPoint().getNetEndPoint().getAPIVersion(), pHelper.getAppSecurityObject().getNICEASEndPoint().getNetEndPoint().getEndPointID(), Constants.CODE_GET_APP_CONTROL_REQUEST, diff --git a/app/src/main/java/com/scenera/nicesecurityapplib/interfaces/ServiceInterfaces.java b/app/src/main/java/com/scenera/nicesecurityapplib/interfaces/ServiceInterfaces.java index 3cf490f..563b60d 100755 --- a/app/src/main/java/com/scenera/nicesecurityapplib/interfaces/ServiceInterfaces.java +++ b/app/src/main/java/com/scenera/nicesecurityapplib/interfaces/ServiceInterfaces.java @@ -60,7 +60,8 @@ public interface GetAppControlObjectEncrypted { @Headers("Content-Type:application/json") @POST("/{Version}/{EndPointID}/management/"+ Constants.ServiceType.GET_APP_CONTROL) - Call getAppControlObject(@Path("Version") String version, + Call getAppControlObject(@Header("Authorization") String auth, + @Path("Version") String version, @Path("EndPointID") String EndPointID, @Query("code") String code, @Body RequestBody requestBody); @@ -81,7 +82,8 @@ public interface GetPrivacyObjectEncrypted { @Headers("Content-Type:application/json") @POST("/{Version}/{EndPointID}/management/"+ Constants.ServiceType.GET_PRIVACY_OBJECT) - Call getPrivacyObject(@Path("Version") String version, + Call getPrivacyObject(@Header("Authorization") String auth, + @Path("Version") String version, @Path("EndPointID") String EndPointID, @Body RequestBody requestBody); diff --git a/app/src/main/java/com/scenera/nicesecurityapplib/viewmodel/MainViewModel.java b/app/src/main/java/com/scenera/nicesecurityapplib/viewmodel/MainViewModel.java index 5b767d2..8ecf366 100755 --- a/app/src/main/java/com/scenera/nicesecurityapplib/viewmodel/MainViewModel.java +++ b/app/src/main/java/com/scenera/nicesecurityapplib/viewmodel/MainViewModel.java @@ -637,7 +637,8 @@ public void getPrivacyObject(AppCompatActivity activity, String currentDate, Str ServiceInterfaces.GetPrivacyObjectEncrypted api = ApiClient.getClientAccount(activity, "https://" + pHelper.getAppSecurityObject().getNICEASEndPoint().getNetEndPoint().getScheme().get(0).getAuthority()).create(ServiceInterfaces.GetPrivacyObjectEncrypted.class); - Call call = api.getPrivacyObject(pHelper.getAppSecurityObject().getNICEASEndPoint().getNetEndPoint().getAPIVersion(), + Call call = api.getPrivacyObject("Bearer "+ accessToken, + pHelper.getAppSecurityObject().getNICEASEndPoint().getNetEndPoint().getAPIVersion(), pHelper.getAppSecurityObject().getNICEASEndPoint().getNetEndPoint().getEndPointID(), ApiClient.makeJSONRequestBody(jsonObjectRequest)); @@ -753,7 +754,8 @@ public void getAppControlObject(AppCompatActivity activity, AppSecurityObjectRes ServiceInterfaces.GetAppControlObjectEncrypted api = ApiClient.getClientAccount(activity,"https://" + pHelper.getAppSecurityObject().getNICEASEndPoint().getNetEndPoint().getScheme().get(0).getAuthority()).create(ServiceInterfaces.GetAppControlObjectEncrypted.class); - Call call = api.getAppControlObject(pHelper.getAppSecurityObject().getNICEASEndPoint().getNetEndPoint().getAPIVersion(), + Call call = api.getAppControlObject("Bearer "+ accessToken, + pHelper.getAppSecurityObject().getNICEASEndPoint().getNetEndPoint().getAPIVersion(), pHelper.getAppSecurityObject().getNICEASEndPoint().getNetEndPoint().getEndPointID(), Constants.CODE_GET_APP_CONTROL_REQUEST, ApiClient.makeJSONRequestBody(jsonObjectRequest)); @@ -849,7 +851,8 @@ private void getAppControlObject(AppSecurityObjectResponse appSecurityObject, ServiceInterfaces.GetAppControlObjectEncrypted api = ApiClient.getClientAccount(activity,"https://" + pHelper.getAppSecurityObject().getNICEASEndPoint().getNetEndPoint().getScheme().get(0).getAuthority()).create(ServiceInterfaces.GetAppControlObjectEncrypted.class); - Call call = api.getAppControlObject(pHelper.getAppSecurityObject().getNICEASEndPoint().getNetEndPoint().getAPIVersion(), + Call call = api.getAppControlObject("Bearer "+ accessToken, + pHelper.getAppSecurityObject().getNICEASEndPoint().getNetEndPoint().getAPIVersion(), pHelper.getAppSecurityObject().getNICEASEndPoint().getNetEndPoint().getEndPointID(), Constants.CODE_GET_APP_CONTROL_REQUEST, ApiClient.makeJSONRequestBody(jsonObjectRequest));