You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by bh...@apache.org on 2019/07/31 13:22:32 UTC

[incubator-dlab] branch dlab_refactored updated: DLAB-000 added keycloak api

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 30a2f99  DLAB-000 added keycloak api
30a2f99 is described below

commit 30a2f99f653206abfbca50ed13d0a45595519fdb
Author: bhliva <bo...@epam.com>
AuthorDate: Wed Jul 31 16:21:02 2019 +0300

    DLAB-000 added keycloak api
---
 .../epam/dlab/backendapi/resources/KeycloakResource.java   | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/KeycloakResource.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/KeycloakResource.java
index 10708b1..70b8b3a 100644
--- a/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/KeycloakResource.java
+++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/KeycloakResource.java
@@ -1,16 +1,18 @@
 package com.epam.dlab.backendapi.resources;
 
+import com.epam.dlab.auth.UserInfo;
 import com.epam.dlab.backendapi.service.SecurityService;
 import com.google.inject.Inject;
+import io.dropwizard.auth.Auth;
 
-import javax.ws.rs.GET;
+import javax.ws.rs.POST;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-@Path("/test")
+@Path("/oauth")
 public class KeycloakResource {
 
 
@@ -21,9 +23,15 @@ public class KeycloakResource {
 		this.securityService = securityService;
 	}
 
-	@GET
+	@POST
 	@Produces(MediaType.APPLICATION_JSON)
 	public Response getUser(@QueryParam("code") String code) {
 		return Response.ok(securityService.getUserInfo(code)).build();
 	}
+
+	@POST
+	@Path("/authorize")
+	public Response authorize(@Auth UserInfo userInfo) {
+		return Response.ok().build();
+	}
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org