@Test(expected = AuthenticationServiceException.class) public void testThrowsExceptionIfUnsupportedMethod() { when(req.getMethod()).thenReturn("GET"); testee.attemptAuthentication(req, resp); }
@Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException { if (!featuresHelper.isFeatureActive(AuthoritiesConstants.FEATURE_OAUTH_AUTHENTICATION)) { throw new AuthenticationServiceException("OAuth authentication is not enabled"); } Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { return authentication; } String jwsToken = extractAccessToken(request); return authenticate(jwsToken); }
JwtAuthenticationFilter extends AbstractAuthenticationProcessingFilter { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException { if (!featuresHelper.isFeatureActive(AuthoritiesConstants.FEATURE_OAUTH_AUTHENTICATION)) { throw new AuthenticationServiceException("OAuth authentication is not enabled"); } Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { return authentication; } String jwsToken = extractAccessToken(request); return authenticate(jwsToken); } }
JwtAuthenticationFilter extends AbstractAuthenticationProcessingFilter { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException { if (!featuresHelper.isFeatureActive(AuthoritiesConstants.FEATURE_OAUTH_AUTHENTICATION)) { throw new AuthenticationServiceException("OAuth authentication is not enabled"); } Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { return authentication; } String jwsToken = extractAccessToken(request); return authenticate(jwsToken); } protected  JwtAuthenticationFilter(RequestMatcher requestMatcher); }
JwtAuthenticationFilter extends AbstractAuthenticationProcessingFilter { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException { if (!featuresHelper.isFeatureActive(AuthoritiesConstants.FEATURE_OAUTH_AUTHENTICATION)) { throw new AuthenticationServiceException("OAuth authentication is not enabled"); } Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { return authentication; } String jwsToken = extractAccessToken(request); return authenticate(jwsToken); } protected  JwtAuthenticationFilter(RequestMatcher requestMatcher); @Override Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response); }
JwtAuthenticationFilter extends AbstractAuthenticationProcessingFilter { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException { if (!featuresHelper.isFeatureActive(AuthoritiesConstants.FEATURE_OAUTH_AUTHENTICATION)) { throw new AuthenticationServiceException("OAuth authentication is not enabled"); } Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { return authentication; } String jwsToken = extractAccessToken(request); return authenticate(jwsToken); } protected  JwtAuthenticationFilter(RequestMatcher requestMatcher); @Override Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response);  }