@Test public void noClients(final TestContext testContext) { final Async async = testContext.async(); final CompletableFuture<HttpAction> future = authenticator.authenticate(webContext, Collections.emptyList()); assertSuccessfulEvaluation(future, a -> { assertThat(a, is(notNullValue())); assertThat(a.getCode(), is(HttpConstants.UNAUTHORIZED)); assertThat(a.getMessage(), is("unauthorized")); }, async); }
public final <U extends CommonProfile> CompletableFuture<HttpAction> authenticate(final C context, final List<AsyncClient<? extends Credentials, U>> currentClients) { if (startAuthentication(context, currentClients)) { logger.debug("Starting authentication"); return indirectAuthenticationInitiator.initiateIndirectFlow(context, currentClients); } else { logger.debug("unauthorized"); return CompletableFuture.completedFuture(unauthorized(context, currentClients)); } }
AsyncDirectAuthFailedAuthenticator { public final <U extends CommonProfile> CompletableFuture<HttpAction> authenticate(final C context, final List<AsyncClient<? extends Credentials, U>> currentClients) { if (startAuthentication(context, currentClients)) { logger.debug("Starting authentication"); return indirectAuthenticationInitiator.initiateIndirectFlow(context, currentClients); } else { logger.debug("unauthorized"); return CompletableFuture.completedFuture(unauthorized(context, currentClients)); } } }
AsyncDirectAuthFailedAuthenticator { public final <U extends CommonProfile> CompletableFuture<HttpAction> authenticate(final C context, final List<AsyncClient<? extends Credentials, U>> currentClients) { if (startAuthentication(context, currentClients)) { logger.debug("Starting authentication"); return indirectAuthenticationInitiator.initiateIndirectFlow(context, currentClients); } else { logger.debug("unauthorized"); return CompletableFuture.completedFuture(unauthorized(context, currentClients)); } }  }
AsyncDirectAuthFailedAuthenticator { public final <U extends CommonProfile> CompletableFuture<HttpAction> authenticate(final C context, final List<AsyncClient<? extends Credentials, U>> currentClients) { if (startAuthentication(context, currentClients)) { logger.debug("Starting authentication"); return indirectAuthenticationInitiator.initiateIndirectFlow(context, currentClients); } else { logger.debug("unauthorized"); return CompletableFuture.completedFuture(unauthorized(context, currentClients)); } }  final CompletableFuture<HttpAction> authenticate(final C context, final List<AsyncClient<? extends Credentials, U>> currentClients); }
AsyncDirectAuthFailedAuthenticator { public final <U extends CommonProfile> CompletableFuture<HttpAction> authenticate(final C context, final List<AsyncClient<? extends Credentials, U>> currentClients) { if (startAuthentication(context, currentClients)) { logger.debug("Starting authentication"); return indirectAuthenticationInitiator.initiateIndirectFlow(context, currentClients); } else { logger.debug("unauthorized"); return CompletableFuture.completedFuture(unauthorized(context, currentClients)); } }  final CompletableFuture<HttpAction> authenticate(final C context, final List<AsyncClient<? extends Credentials, U>> currentClients);  }