.setupCallback(router.route("/callback"))
oauth2Handler.setupCallback(router.route());
/** * add the callback handler to a given route. * @param route a given route e.g.: `/callback` * @return self */ public io.vertx.rxjava.ext.web.handler.OAuth2AuthHandler setupCallback(io.vertx.rxjava.ext.web.Route route) { delegate.setupCallback(route.getDelegate()); return this; }
/** * add the callback handler to a given route. * @param route a given route e.g.: `/callback` * @return self */ public io.vertx.rxjava.ext.web.handler.OAuth2AuthHandler setupCallback(io.vertx.rxjava.ext.web.Route route) { delegate.setupCallback(route.getDelegate()); return this; }
router.route().handler(OAuth2AuthHandler.create(oauth2, "http://localhost:8080/callback").setupCallback(router.route())); OAuth2AuthHandler oauth2Handler = OAuth2AuthHandler.create(oauth2, "http://localhost:8080/callback").setupCallback(router.route());
private static OAuth2AuthHandler standardAuth(Vertx vertx, Router router, VertxEngineConfig apimanConfig, JsonObject authConfig, OAuth2FlowType flowType) { String proto = apimanConfig.isSSL() ? "https://" : "http://"; int port = apimanConfig.getPort(ApiVerticle.VERTICLE_TYPE); String hostname = Optional.of(apimanConfig.getPublicEndpoint()).orElse(apimanConfig.getHostname()); String redirect = proto + hostname + ":" + port; // Redirect back here to *after* auth. // Set up KC OAuth2 Authentication OAuth2AuthHandler auth = OAuth2AuthHandler.create(KeycloakAuth.create(vertx, flowType, authConfig), redirect); // Callback can be anything (as long as it's not already used by something else). auth.setupCallback(router.get("/callback")); return auth; }
oauth2Handler.setupCallback(router.route());
router.route().handler(OAuth2AuthHandler.create(oauth2, "http://localhost:8080/callback").setupCallback(router.route())); OAuth2AuthHandler oauth2Handler = OAuth2AuthHandler.create(oauth2, "http://localhost:8080/callback").setupCallback(router.route());