private boolean authenticationNotAttempted(HttpServletRequest request, HttpServletResponse response) { authenticationListener.authenticationNotAttempted(request, response); return true; }
authenticationListener.authenticationSuccess(result, request, response); return true; case NO_ATTEMPT: authenticationListener.authenticationNotAttempted(request, response); return true; case FAILED: authenticationListener.authenticationFailure(result, request, response); setFailureResponse(result, response); return false; case ERROR: default: authenticationListener.authenticationError(result, request, response); setErrorResponse(result, response); return false;
authenticationListener.authenticationFailure(result, request, response); return false; authenticationListener.authenticationError(result, request, response); return false; authenticationListener.authenticationNotAttempted(request, response); return true;
private void impersonateSubject(FilterChain filterChain, HttpServletRequest request, HttpServletResponse response, UserProfile userProfile) throws IOException, ServletException { // Products use the username to set the authentication context. SimplePrincipal principal = new SimplePrincipal(userProfile.getUsername()); final Authenticator.Result authenticationResult = new Authenticator.Result.Success(createMessage("Successful three-legged-auth"), principal); authenticationListener.authenticationSuccess(authenticationResult, request, response); filterChain.doFilter(request, response); }
private void fail(HttpServletRequest request, HttpServletResponse response, String externallyVisibleMessage, int httpResponseCode) { sendErrorResponse(response, httpResponseCode, externallyVisibleMessage); authenticationListener.authenticationFailure(new Authenticator.Result.Failure(createMessage("")), request, response); }
private boolean mayProceed(HttpServletRequest request, HttpServletResponse response, OAuthRequestVerifier verifier) { authenticationListener.authenticationNotAttempted(request, response); return true; authenticationListener.authenticationNotAttempted(request, response); return true; authenticationListener.authenticationFailure(result, request, response); OAuthProblemUtils.logOAuthRequest(request, "OAuth authentication FAILED.", LOG); return false; authenticationListener.authenticationError(result, request, response); OAuthProblemUtils.logOAuthRequest(request, "OAuth authentication ERRORED.", LOG); return false; authenticationListener.authenticationSuccess(result, request, response);
private void actAsAddonUser(FilterChain filterChain, HttpServletRequest request, HttpServletResponse response, String addonKey) throws IOException, ServletException { try { final Principal principal = getPrincipal(addonKey); final Authenticator.Result authenticationResult = new Authenticator.Result.Success(createMessage("Successful two-legged-auth"), principal); authenticationListener.authenticationSuccess(authenticationResult, request, response); filterChain.doFilter(request, response); } catch (InvalidSubjectException e) { createAndSendFailure(e, response, HttpServletResponse.SC_UNAUTHORIZED, badCredentialsMessage); } }
private void fail(HttpServletRequest request, HttpServletResponse response, String externallyVisibleMessage, int httpResponseCode) { sendErrorResponse(response, httpResponseCode, externallyVisibleMessage); authenticationListener.authenticationFailure(new Authenticator.Result.Failure(createMessage("")), request, response); }
case SUCCESS: authenticationListener.authenticationSuccess(result, request, response); authenticationSuccessListener.authenticationSuccess(result.getPrincipal(), request, response); return true; case NO_ATTEMPT: authenticationListener.authenticationNotAttempted(request, response); return true; case FAILED: authenticationListener.authenticationFailure(result, request, response); setFailureResponse(result, request, response); return false; case ERROR: default: authenticationListener.authenticationError(result, request, response); setErrorResponse(result, request, response); return false;
private void impersonateSubject(FilterChain filterChain, HttpServletRequest request, HttpServletResponse response, UserProfile userProfile) throws IOException, ServletException { // Products use the username to set the authentication context. SimplePrincipal principal = new SimplePrincipal(userProfile.getUsername()); final Authenticator.Result authenticationResult = new Authenticator.Result.Success(createMessage("Successful three-legged-auth"), principal); authenticationListener.authenticationSuccess(authenticationResult, request, response); filterChain.doFilter(request, response); }
private boolean authenticationNotAttempted(HttpServletRequest request, HttpServletResponse response) { authenticationListener.authenticationNotAttempted(request, response); return true; }
private void actAsAddonUser(FilterChain filterChain, HttpServletRequest request, HttpServletResponse response, String addonKey) throws IOException, ServletException { try { final Principal principal = getPrincipal(addonKey); final Authenticator.Result authenticationResult = new Authenticator.Result.Success(createMessage("Successful two-legged-auth"), principal); authenticationListener.authenticationSuccess(authenticationResult, request, response); filterChain.doFilter(request, response); } catch (InvalidSubjectException e) { createAndSendFailure(e, response, HttpServletResponse.SC_UNAUTHORIZED, i18nResolver.getText(BAD_CREDENTIALS_KEY)); } }
private boolean authenticationNotAttempted(HttpServletRequest request, HttpServletResponse response) { authenticationListener.authenticationNotAttempted(request, response); return true; }