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