private void login(HttpServletRequest httpRequest, HttpServletResponse httpResponse, HandlerChain chain) throws IOException {
String state = generateState();
httpRequest.getSession().setAttribute(OAUTH_STATE_ATTR_NAME, state);
URLBuilder authUrl = new URLBuilder(this.authorizationEndpoint);
authUrl.addParameter("state", state);
authUrl.addParameter("client_id", this.config.getKey());
authUrl.addParameter("response_type", "code");
authUrl.addParameter("scope", "openid email profile");
authUrl.addParameter("redirect_uri", httpRequest.getRequestURL().toString());
httpResponse.sendRedirect(authUrl.build());
}