static ChainAuthHandler create() { return new ChainAuthHandlerImpl(); }
@Override public void parseCredentials(RoutingContext context, Handler<AsyncResult<JsonObject>> handler) { // iterate all possible authN iterate(0, context, null, handler); }
/** * Override process exception to handle custom OAuth 2.0 invalid client exception * @param ctx routing context * @param exception exception thrown */ @Override protected void processException(RoutingContext ctx, Throwable exception) { if (exception != null) { if (exception instanceof HttpStatusException) { final int statusCode = ((HttpStatusException) exception).getStatusCode(); if (statusCode == 401) { // client authentication has failed return invalid client exception ctx.fail(new InvalidClientException("Client authentication failed due to unknown or invalid client")); return; } } } super.processException(ctx, exception); }
/** * Override process exception to handle custom OAuth 2.0 invalid client exception * @param ctx routing context * @param exception exception thrown */ @Override protected void processException(RoutingContext ctx, Throwable exception) { if (exception != null) { if (exception instanceof HttpStatusException) { final int statusCode = ((HttpStatusException) exception).getStatusCode(); if (statusCode == 401) { // client authentication has failed return invalid client exception ctx.fail(new InvalidClientException("Client authentication failed due to unknown or invalid client")); return; } } } super.processException(ctx, exception); }
case 403: iterate(idx + 1, ctx, exception, handler); return;
static ChainAuthHandler create() { return new ChainAuthHandlerImpl(); }
@Override public void parseCredentials(RoutingContext context, Handler<AsyncResult<JsonObject>> handler) { // iterate all possible authN iterate(0, context, null, handler); }
case 403: iterate(idx + 1, ctx, exception, handler); return;