Commit 683dce59 by Tuomas Riihimäki

We need to add domain to logging in username because we no longer inject it in H…

…ostnameFilter to BortalLocalContextHolder
1 parent 91223aea
...@@ -23,8 +23,8 @@ import io.swagger.annotations.Api; ...@@ -23,8 +23,8 @@ import io.swagger.annotations.Api;
@RequestScoped @RequestScoped
@Path("/apiapp/v1") @Path("/apiapp/v1")
@Consumes({ MediaType.APPLICATION_JSON }) @Consumes({MediaType.APPLICATION_JSON})
@Produces({ MediaType.APPLICATION_JSON + "; charset=UTF-8" }) @Produces({MediaType.APPLICATION_JSON + "; charset=UTF-8"})
@Api(value = "/apiapp/v1/", description = "Manage api application and keys") @Api(value = "/apiapp/v1/", description = "Manage api application and keys")
public class ApiAppRestViewV1 { public class ApiAppRestViewV1 {
...@@ -49,7 +49,9 @@ public class ApiAppRestViewV1 { ...@@ -49,7 +49,9 @@ public class ApiAppRestViewV1 {
principal = null; principal = null;
} }
servletRequest.getSession(true); servletRequest.getSession(true);
servletRequest.login(username, password); String domain = servletRequest.getHeader("host");
servletRequest.login(username + "@" + domain, password);
ApiApplication app = apibean.findApplication(appKey); ApiApplication app = apibean.findApplication(appKey);
ApiApplicationInstance apiInstance = apibean.createApplicationInstance(app); ApiApplicationInstance apiInstance = apibean.createApplicationInstance(app);
......
...@@ -60,8 +60,10 @@ public class EventInfoV1 { ...@@ -60,8 +60,10 @@ public class EventInfoV1 {
if (principal != null && principal.getName() != null) { if (principal != null && principal.getName() != null) {
servletRequest.logout(); servletRequest.logout();
} }
String domain = servletRequest.getHeader("host");
servletRequest.getSession(true); servletRequest.getSession(true);
servletRequest.login(username, password); servletRequest.login(username + "@"+domain, password);
} }
return Response.ok(PojoUtils.parseEvents(eventBean.findAllEventsForCurrentUser())).build(); return Response.ok(PojoUtils.parseEvents(eventBean.findAllEventsForCurrentUser())).build();
} catch (ServletException e) { } catch (ServletException e) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!