bhliva commented on a change in pull request #331: [DLAB-1156]: Created 
endpoint to get new access and refresh token in …
URL: https://github.com/apache/incubator-dlab/pull/331#discussion_r330506916
 
 

 ##########
 File path: 
services/self-service/src/main/java/com/epam/dlab/backendapi/resources/KeycloakResource.java
 ##########
 @@ -78,4 +83,24 @@ public Response getLogoutUrl() throws URISyntaxException {
                                .location(new URI(logoutUri + redirectUri))
                                .build();
        }
+
+       @POST
+       @Path("/refresh/{refresh_token}")
+       @Produces(MediaType.APPLICATION_JSON)
+       public Response refreshAccessToken(@PathParam("refresh_token") String 
refreshToken) {
+               AccessTokenResponse tokenResponse = 
keycloakService.refreshToken(refreshToken);
+               return Response.ok(new TokenInfo(tokenResponse.getToken(), 
tokenResponse.getRefreshToken())).build();
+       }
 
 Review comment:
   please add test for that method

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to