This is an automated email from the ASF dual-hosted git repository.

bhliva pushed a commit to branch dlab_refactored
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git


The following commit(s) were added to refs/heads/dlab_refactored by this push:
     new fd3f535  DLAB-000 logging added
fd3f535 is described below

commit fd3f5358e94311252bc1287d9f12563128baeb9b
Author: bhliva <[email protected]>
AuthorDate: Fri Aug 2 15:57:23 2019 +0300

    DLAB-000 logging added
---
 .../java/com/epam/dlab/backendapi/service/KeycloakServiceImpl.java    | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/KeycloakServiceImpl.java
 
b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/KeycloakServiceImpl.java
index 829a8c2..4631a86 100644
--- 
a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/KeycloakServiceImpl.java
+++ 
b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/KeycloakServiceImpl.java
@@ -4,6 +4,7 @@ import 
com.epam.dlab.backendapi.SelfServiceApplicationConfiguration;
 import com.epam.dlab.exceptions.DlabException;
 import com.google.inject.Inject;
 import de.ahus1.keycloak.dropwizard.KeycloakConfiguration;
+import lombok.extern.slf4j.Slf4j;
 import org.glassfish.jersey.internal.util.Base64;
 import org.keycloak.representations.AccessTokenResponse;
 
@@ -13,6 +14,7 @@ import javax.ws.rs.core.Form;
 import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.Response;
 
+@Slf4j
 public class KeycloakServiceImpl implements KeycloakService {
 
        private static final String URI = 
"/realms/DLAB_bhliva/protocol/openid-connect/token";
@@ -42,6 +44,8 @@ public class KeycloakServiceImpl implements KeycloakService {
                                .header(HttpHeaders.AUTHORIZATION, "Basic " + 
credentials)
                                .post(Entity.form(requestForm));
                if (response.getStatusInfo().getFamily() != 
Response.Status.Family.SUCCESSFUL) {
+
+                       log.error("Error getting token:code {}, body {}", 
response.getStatus(), response.readEntity(String.class));
                        throw new DlabException("can not get token");
                }
                return response.readEntity(AccessTokenResponse.class);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to