I am working on a J2EE application which is incorporating
com.vaadin.cdi.access.JaasAccessControl
for authentication in a vaadin application. For testing purposes I would like to reuse the JaasAccessControl.login() method already implemented by the team. Thus I call the login mechanism by simply:
@Inject
private LoginViewController loginController;
@GET
@Path("/login")
@Produces( MediaType.TEXT_PLAIN )
public String login() {
JaasAccessControl.login("user", HashcodeGenerator.generateHashCode("password"));
}
However, my request fails due to NPE in JaasAccessControl line 73, probably because getCurrentRequest()
is null. My REST method of course is not a Vaadin page. Are there any ways I can use this from a Rest implementation?