@Test public void testInboundInvalidToken() throws ExecutionException, InterruptedException, GeneralSecurityException, IOException { GoogleIdTokenVerifier verifier = mock(GoogleIdTokenVerifier.class); when(verifier.verify(TOKEN_VALUE)).thenReturn(null); GoogleTokenProvider provider = GoogleTokenProvider.builder().clientId("clientId").verifier(verifier).build(); ProviderRequest inboundRequest = createInboundRequest("Authorization", "bearer " + TOKEN_VALUE); AuthenticationResponse response = provider.authenticate(inboundRequest).toCompletableFuture().get(); assertThat(response.status(), is(SecurityResponse.SecurityStatus.FAILURE)); assertThat(response.statusCode().orElse(200), is(401)); assertThat(response.responseHeaders().get("WWW-Authenticate"), notNullValue()); }
public static Builder builder() { return new Builder(); }
GoogleTokenProvider extends SynchronousProvider implements AuthenticationProvider, OutboundSecurityProvider { public static Builder builder() { return new Builder(); } }
GoogleTokenProvider extends SynchronousProvider implements AuthenticationProvider, OutboundSecurityProvider { public static Builder builder() { return new Builder(); } private  GoogleTokenProvider(Builder builder); }
GoogleTokenProvider extends SynchronousProvider implements AuthenticationProvider, OutboundSecurityProvider { public static Builder builder() { return new Builder(); } private  GoogleTokenProvider(Builder builder); static GoogleTokenProvider create(Config config); static Builder builder(); @Override boolean isOutboundSupported(ProviderRequest providerRequest,
                                       SecurityEnvironment outboundEnv,
                                       EndpointConfig outboundConfig); }
GoogleTokenProvider extends SynchronousProvider implements AuthenticationProvider, OutboundSecurityProvider { public static Builder builder() { return new Builder(); } private  GoogleTokenProvider(Builder builder); static GoogleTokenProvider create(Config config); static Builder builder(); @Override boolean isOutboundSupported(ProviderRequest providerRequest,
                                       SecurityEnvironment outboundEnv,
                                       EndpointConfig outboundConfig);  }