@Override
 public void afterPropertiesSet() {
   super.afterPropertiesSet();
   setAuthenticationFailureHandler(
       new AuthenticationFailureHandler() {
         public void onAuthenticationFailure(
             HttpServletRequest request,
             HttpServletResponse response,
             AuthenticationException exception)
             throws IOException, ServletException {
           if (exception instanceof BadCredentialsException) {
             exception =
                 new BadCredentialsException(
                     exception.getMessage(), new BadClientCredentialsException());
           }
           authenticationEntryPoint.commence(request, response, exception);
         }
       });
   setAuthenticationSuccessHandler(
       new AuthenticationSuccessHandler() {
         public void onAuthenticationSuccess(
             HttpServletRequest request,
             HttpServletResponse response,
             Authentication authentication)
             throws IOException, ServletException {
           // no-op - just allow filter chain to continue to token endpoint
         }
       });
 }
 /** Check properties are set */
 @Override
 public void afterPropertiesSet() {
   super.afterPropertiesSet();
   Assert.notNull(oAuth2ServiceProperties);
   Assert.isTrue(
       oAuth2ServiceProperties.getRedirectUri().endsWith(super.getFilterProcessesUrl()),
       "The filter must be configured to be listening on the redirect_uri in OAuth2ServiceProperties");
 }
Exemplo n.º 3
0
 @Override
 public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
     throws IOException, ServletException {
   HttpServletRequest request = (HttpServletRequest) req;
   Remembered r = getCookie(request);
   if (r == null || r.isExpired()) // вычищаем контекст, чтобы обновить авторизацию
   SecurityContextHolder.clearContext();
   super.doFilter(req, res, chain);
 }
 @Override
 protected void successfulAuthentication(
     HttpServletRequest request,
     HttpServletResponse response,
     FilterChain chain,
     Authentication authResult)
     throws IOException, ServletException {
   super.successfulAuthentication(request, response, chain, authResult);
   chain.doFilter(request, response);
 }
  @Override
  public void afterPropertiesSet() {
    super.afterPropertiesSet();

    // if our JOSE validators don't get wired in, drop defaults into place

    if (validationServices == null) {
      validationServices = new JWKSetCacheService();
    }

    if (symmetricCacheService == null) {
      symmetricCacheService = new SymmetricKeyJWTValidatorCacheService();
    }
  }
 @Override
 public void afterPropertiesSet() {
   super.afterPropertiesSet();
   CommonHelper.assertNotNull("clients", this.clients);
   this.clients.init();
 }
 @Override
 public void setAuthenticationSuccessHandler(AuthenticationSuccessHandler successHandler) {
   targetSuccessHandler.passthrough = successHandler;
   super.setAuthenticationSuccessHandler(targetSuccessHandler);
 }
 /** OpenIdConnectAuthenticationFilter constructor */
 public OIDCAuthenticationFilter() {
   super(FILTER_PROCESSES_URL);
   targetSuccessHandler.passthrough = super.getSuccessHandler();
   super.setAuthenticationSuccessHandler(targetSuccessHandler);
 }