router.route().handler(UserSessionHandler.create(authProvider));
/** * Something has happened, so handle it. * @param event the event to handle */ public void handle(io.vertx.rxjava.ext.web.RoutingContext event) { delegate.handle(event.getDelegate()); }
/** * Something has happened, so handle it. * @param event the event to handle */ public void handle(io.vertx.rxjava.ext.web.RoutingContext event) { delegate.handle(event.getDelegate()); }
router.route().handler(UserSessionHandler.create(authProvider));
router.route().handler(UserSessionHandler.create(authProvider));
router.route().handler(UserSessionHandler.create(authProvider));
/** * Create a new handler * @param authProvider The auth provider to use * @return the handler */ public static io.vertx.rxjava.ext.web.handler.UserSessionHandler create(io.vertx.rxjava.ext.auth.AuthProvider authProvider) { io.vertx.rxjava.ext.web.handler.UserSessionHandler ret = io.vertx.rxjava.ext.web.handler.UserSessionHandler.newInstance(io.vertx.ext.web.handler.UserSessionHandler.create(authProvider.getDelegate())); return ret; }
/** * Create a new handler * @param authProvider The auth provider to use * @return the handler */ public static io.vertx.rxjava.ext.web.handler.UserSessionHandler create(io.vertx.rxjava.ext.auth.AuthProvider authProvider) { io.vertx.rxjava.ext.web.handler.UserSessionHandler ret = io.vertx.rxjava.ext.web.handler.UserSessionHandler.newInstance(io.vertx.ext.web.handler.UserSessionHandler.create(authProvider.getDelegate())); return ret; }
router.route().handler(UserSessionHandler.create(authProvider)); router.route("/protected/*").handler(BasicAuthHandler.create(authProvider));
private void doLoginCommon(Handler<RoutingContext> handler, Set<String> authorities) throws Exception { router.route().handler(BodyHandler.create()); router.route().handler(CookieHandler.create()); SessionStore store = LocalSessionStore.create(vertx); router.route().handler(SessionHandler.create(store)); router.route().handler(UserSessionHandler.create(authProvider)); AuthHandler authHandler = RedirectAuthHandler.create(authProvider); if (authorities != null) { authHandler.addAuthorities(authorities); } router.route("/protected/*").handler(authHandler); router.route("/protected/somepage").handler(handler); String loginHTML = createloginHTML(); router.route("/loginpage").handler(rc -> rc.response().putHeader("content-type", "text/html").end(loginHTML)); if (formLoginHandler == null) { formLoginHandler = FormLoginHandler.create(authProvider); } router.route("/login").handler(formLoginHandler); testRequest(HttpMethod.GET, "/protected/somepage", null, resp -> { String location = resp.headers().get("location"); assertNotNull(location); assertEquals("/loginpage", location); String setCookie = resp.headers().get("set-cookie"); assertNotNull(setCookie); sessionCookie.set(setCookie); }, 302, "Found", null); testRequest(HttpMethod.GET, "/loginpage", req -> req.putHeader("cookie", sessionCookie.get()), resp -> { }, 200, "OK", loginHTML); }
SessionStore store = LocalSessionStore.create(vertx); router.route().handler(SessionHandler.create(store)); router.route().handler(UserSessionHandler.create(authProvider)); AuthHandler authHandler = RedirectAuthHandler.create(authProvider);
private void initUserSessionHandler() { getNetRelay().getRouter().route().handler(UserSessionHandler.create(getAuthProvider())); }
router.route().handler(UserSessionHandler.create(oauth2));
router.route().handler(UserSessionHandler.create(authProvider)); router.route("/protected/*").handler(BasicAuthHandler.create(authProvider));
private void doLoginCommon(Handler<RoutingContext> handler, Set<String> authorities) throws Exception { router.route().handler(BodyHandler.create()); router.route().handler(CookieHandler.create()); SessionStore store = LocalSessionStore.create(vertx); router.route().handler(SessionHandler.create(store)); router.route().handler(UserSessionHandler.create(authProvider)); AuthHandler authHandler = RedirectAuthHandler.create(authProvider); if (authorities != null) { authHandler.addAuthorities(authorities); } router.route("/protected/*").handler(authHandler); router.route("/protected/somepage").handler(handler); String loginHTML = createloginHTML(); router.route("/loginpage").handler(rc -> rc.response().putHeader("content-type", "text/html").end(loginHTML)); if (formLoginHandler == null) { formLoginHandler = FormLoginHandler.create(authProvider); } router.route("/login").handler(formLoginHandler); testRequest(HttpMethod.GET, "/protected/somepage", null, resp -> { String location = resp.headers().get("location"); assertNotNull(location); assertEquals("/loginpage", location); String setCookie = resp.headers().get("set-cookie"); assertNotNull(setCookie); sessionCookie.set(setCookie); }, 302, "Found", null); testRequest(HttpMethod.GET, "/loginpage", req -> req.putHeader("cookie", sessionCookie.get()), resp -> { }, 200, "OK", loginHTML); }
SessionStore store = LocalSessionStore.create(vertx); router.route().handler(SessionHandler.create(store)); router.route().handler(UserSessionHandler.create(authProvider)); AuthHandler authHandler = RedirectAuthHandler.create(authProvider);