@Test public void attemptAuthentication_error() throws Exception { HttpServletRequest request = Mockito.mock(HttpServletRequest.class); Mockito.when(request.getParameter("error")).thenReturn("Error"); Mockito.when(request.getParameter("error_description")).thenReturn("Description"); Mockito.when(request.getParameter("error_uri")).thenReturn("http: try { filter.attemptAuthentication(request, mock(HttpServletResponse.class)); fail("AuthorizationEndpointException expected."); } catch (AuthorizationEndpointException exception) { assertThat(exception.getMessage(), is("Error from Authorization Endpoint: Error Description http: assertThat(exception.getError(), is("Error")); assertThat(exception.getErrorDescription(), is("Description")); assertThat(exception.getErrorURI(), is("http: assertThat(exception, is(instanceOf(AuthenticationServiceException.class))); } }
@Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { if (!Strings.isNullOrEmpty(request.getParameter("error"))) { handleError(request, response); return null; } else if (!Strings.isNullOrEmpty(request.getParameter("code"))) { Authentication auth = handleAuthorizationCodeResponse(request, response); return auth; } else { handleAuthorizationRequest(request, response); return null; } }
OIDCAuthenticationFilter extends AbstractAuthenticationProcessingFilter { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { if (!Strings.isNullOrEmpty(request.getParameter("error"))) { handleError(request, response); return null; } else if (!Strings.isNullOrEmpty(request.getParameter("code"))) { Authentication auth = handleAuthorizationCodeResponse(request, response); return auth; } else { handleAuthorizationRequest(request, response); return null; } } }
OIDCAuthenticationFilter extends AbstractAuthenticationProcessingFilter { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { if (!Strings.isNullOrEmpty(request.getParameter("error"))) { handleError(request, response); return null; } else if (!Strings.isNullOrEmpty(request.getParameter("code"))) { Authentication auth = handleAuthorizationCodeResponse(request, response); return auth; } else { handleAuthorizationRequest(request, response); return null; } } OIDCAuthenticationFilter(); }
OIDCAuthenticationFilter extends AbstractAuthenticationProcessingFilter { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { if (!Strings.isNullOrEmpty(request.getParameter("error"))) { handleError(request, response); return null; } else if (!Strings.isNullOrEmpty(request.getParameter("code"))) { Authentication auth = handleAuthorizationCodeResponse(request, response); return auth; } else { handleAuthorizationRequest(request, response); return null; } } OIDCAuthenticationFilter(); @Override void afterPropertiesSet(); @Override Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response); @Override void setAuthenticationSuccessHandler(AuthenticationSuccessHandler successHandler); int getTimeSkewAllowance(); void setTimeSkewAllowance(int timeSkewAllowance); JWKSetCacheService getValidationServices(); void setValidationServices(JWKSetCacheService validationServices); ServerConfigurationService getServerConfigurationService(); void setServerConfigurationService(ServerConfigurationService servers); ClientConfigurationService getClientConfigurationService(); void setClientConfigurationService(ClientConfigurationService clients); IssuerService getIssuerService(); void setIssuerService(IssuerService issuerService); AuthRequestUrlBuilder getAuthRequestUrlBuilder(); void setAuthRequestUrlBuilder(AuthRequestUrlBuilder authRequestBuilder); AuthRequestOptionsService getAuthRequestOptionsService(); void setAuthRequestOptionsService(AuthRequestOptionsService authOptions); SymmetricKeyJWTValidatorCacheService getSymmetricCacheService(); void setSymmetricCacheService(SymmetricKeyJWTValidatorCacheService symmetricCacheService); TargetLinkURIAuthenticationSuccessHandler getTargetLinkURIAuthenticationSuccessHandler(); void setTargetLinkURIAuthenticationSuccessHandler(
			TargetLinkURIAuthenticationSuccessHandler targetSuccessHandler); TargetLinkURIChecker targetLinkURIChecker(); void setTargetLinkURIChecker(TargetLinkURIChecker deepLinkFilter); }
OIDCAuthenticationFilter extends AbstractAuthenticationProcessingFilter { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { if (!Strings.isNullOrEmpty(request.getParameter("error"))) { handleError(request, response); return null; } else if (!Strings.isNullOrEmpty(request.getParameter("code"))) { Authentication auth = handleAuthorizationCodeResponse(request, response); return auth; } else { handleAuthorizationRequest(request, response); return null; } } OIDCAuthenticationFilter(); @Override void afterPropertiesSet(); @Override Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response); @Override void setAuthenticationSuccessHandler(AuthenticationSuccessHandler successHandler); int getTimeSkewAllowance(); void setTimeSkewAllowance(int timeSkewAllowance); JWKSetCacheService getValidationServices(); void setValidationServices(JWKSetCacheService validationServices); ServerConfigurationService getServerConfigurationService(); void setServerConfigurationService(ServerConfigurationService servers); ClientConfigurationService getClientConfigurationService(); void setClientConfigurationService(ClientConfigurationService clients); IssuerService getIssuerService(); void setIssuerService(IssuerService issuerService); AuthRequestUrlBuilder getAuthRequestUrlBuilder(); void setAuthRequestUrlBuilder(AuthRequestUrlBuilder authRequestBuilder); AuthRequestOptionsService getAuthRequestOptionsService(); void setAuthRequestOptionsService(AuthRequestOptionsService authOptions); SymmetricKeyJWTValidatorCacheService getSymmetricCacheService(); void setSymmetricCacheService(SymmetricKeyJWTValidatorCacheService symmetricCacheService); TargetLinkURIAuthenticationSuccessHandler getTargetLinkURIAuthenticationSuccessHandler(); void setTargetLinkURIAuthenticationSuccessHandler(
			TargetLinkURIAuthenticationSuccessHandler targetSuccessHandler); TargetLinkURIChecker targetLinkURIChecker(); void setTargetLinkURIChecker(TargetLinkURIChecker deepLinkFilter); final static String FILTER_PROCESSES_URL; }