protected void fail ( HttpServletRequest request , HttpServletResponse response , AuthenticationException failure ) throws IOException , ServletException { SecurityContextHolder . getContext ( ) . setAuthentication ( null ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( failure ) ; } authenticationEntryPoint . commence ( request , response , failure ) ; }
Common logic for OAuth failed .