public static Session createSession(String sessionToken) throws UnauthorizedException { SecurityInformation securityInformation = hah.getSecurityInformation(sessionToken); String emailAddress = securityInformation.getEmailAddress(); User user = userservice.getByEmail(emailAddress); if (user == null) { throw new UnauthorizedException( "The email address given by the securityservice (" + emailAddress + ") is not registered to a user in elaborate"); } return new Session(user.getId()); }