Codota Logo
FormLoginHandler.create
Code IndexAdd Codota to your IDE (free)

How to use
create
method
in
io.vertx.ext.web.handler.FormLoginHandler

Best Java code snippets using io.vertx.ext.web.handler.FormLoginHandler.create (Showing top 16 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: vert-x3/vertx-examples

router.route("/loginhandler").handler(FormLoginHandler.create(authProvider));
origin: vert-x3/vertx-examples

router.route("/loginhandler").handler(FormLoginHandler.create(authProvider));
origin: vert-x3/vertx-web

@Test
public void testLoginChangeFormLoginHandlerParams() throws Exception {
 formLoginHandler = FormLoginHandler.create(authProvider);
 usernameParam = "username2";
 passwordParam ="password2";
 formLoginHandler.setUsernameParam(usernameParam).setPasswordParam(passwordParam);
 testLogin();
}
origin: io.vertx/vertx-rx-java

/**
 * Create a handler
 * @param authProvider the auth service to use
 * @return the handler
 */
public static io.vertx.rxjava.ext.web.handler.FormLoginHandler create(io.vertx.rxjava.ext.auth.AuthProvider authProvider) { 
 io.vertx.rxjava.ext.web.handler.FormLoginHandler ret = io.vertx.rxjava.ext.web.handler.FormLoginHandler.newInstance(io.vertx.ext.web.handler.FormLoginHandler.create(authProvider.getDelegate()));
 return ret;
}
origin: vert-x3/vertx-rx

/**
 * Create a handler
 * @param authProvider the auth service to use
 * @return the handler
 */
public static io.vertx.rxjava.ext.web.handler.FormLoginHandler create(io.vertx.rxjava.ext.auth.AuthProvider authProvider) { 
 io.vertx.rxjava.ext.web.handler.FormLoginHandler ret = io.vertx.rxjava.ext.web.handler.FormLoginHandler.newInstance(io.vertx.ext.web.handler.FormLoginHandler.create(authProvider.getDelegate()));
 return ret;
}
origin: io.vertx/vertx-rx-java

/**
 * Create a handler
 * @param authProvider the auth service to use
 * @param usernameParam the value of the form attribute which will contain the username
 * @param passwordParam the value of the form attribute which will contain the password
 * @param returnURLParam the value of the session attribute which will contain the return url
 * @param directLoggedInOKURL a url to redirect to if the user logs in directly at the url of the form login handler without being redirected here first
 * @return the handler
 */
public static io.vertx.rxjava.ext.web.handler.FormLoginHandler create(io.vertx.rxjava.ext.auth.AuthProvider authProvider, String usernameParam, String passwordParam, String returnURLParam, String directLoggedInOKURL) { 
 io.vertx.rxjava.ext.web.handler.FormLoginHandler ret = io.vertx.rxjava.ext.web.handler.FormLoginHandler.newInstance(io.vertx.ext.web.handler.FormLoginHandler.create(authProvider.getDelegate(), usernameParam, passwordParam, returnURLParam, directLoggedInOKURL));
 return ret;
}
origin: vert-x3/vertx-web

@Test
public void testFormLoginHandlerDirectDefaultResponse() throws Exception {
 formLoginHandler = FormLoginHandler.create(authProvider);
 usernameParam = "username2";
 passwordParam ="password2";
 formLoginHandler.setUsernameParam(usernameParam).setPasswordParam(passwordParam);
 router.route().handler(LoggerHandler.create());
 router.route().handler(BodyHandler.create());
 router.route().handler(CookieHandler.create());
 router.route("/login").handler(formLoginHandler);
 testRequest(HttpMethod.POST, "/login", sendLoginRequestConsumer(), resp -> {
 }, 200, "OK", "<html><body><h1>Login successful</h1></body></html>");
}
origin: vert-x3/vertx-rx

/**
 * Create a handler
 * @param authProvider the auth service to use
 * @param usernameParam the value of the form attribute which will contain the username
 * @param passwordParam the value of the form attribute which will contain the password
 * @param returnURLParam the value of the session attribute which will contain the return url
 * @param directLoggedInOKURL a url to redirect to if the user logs in directly at the url of the form login handler without being redirected here first
 * @return the handler
 */
public static io.vertx.rxjava.ext.web.handler.FormLoginHandler create(io.vertx.rxjava.ext.auth.AuthProvider authProvider, String usernameParam, String passwordParam, String returnURLParam, String directLoggedInOKURL) { 
 io.vertx.rxjava.ext.web.handler.FormLoginHandler ret = io.vertx.rxjava.ext.web.handler.FormLoginHandler.newInstance(io.vertx.ext.web.handler.FormLoginHandler.create(authProvider.getDelegate(), usernameParam, passwordParam, returnURLParam, directLoggedInOKURL));
 return ret;
}
origin: vert-x3/vertx-web

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);
}
origin: vert-x3/vertx-web

router.route("/login").handler(FormLoginHandler.create(authProvider));
origin: vert-x3/vertx-web

@Test
public void testFormLoginHandlerDirectSpecifyLoggedInURL() throws Exception {
 formLoginHandler = FormLoginHandler.create(authProvider);
 usernameParam = "username2";
 passwordParam ="password2";
 String loggedInDirectOKPage = "/youloggedinokpage.html";
 formLoginHandler.setUsernameParam(usernameParam).setPasswordParam(passwordParam).setDirectLoggedInOKURL(loggedInDirectOKPage);
 router.route().handler(LoggerHandler.create());
 router.route().handler(BodyHandler.create());
 router.route().handler(CookieHandler.create());
 router.route("/login").handler(formLoginHandler);
 testRequest(HttpMethod.POST, "/login", sendLoginRequestConsumer(), resp -> {
  String location = resp.headers().get("location");
  assertNotNull(location);
  assertEquals(loggedInDirectOKPage, location);
 }, 302, "Found", null);
}
origin: io.vertx/vertx-web

@Test
public void testLoginChangeFormLoginHandlerParams() throws Exception {
 formLoginHandler = FormLoginHandler.create(authProvider);
 usernameParam = "username2";
 passwordParam ="password2";
 formLoginHandler.setUsernameParam(usernameParam).setPasswordParam(passwordParam);
 testLogin();
}
origin: io.vertx/vertx-web

@Test
public void testFormLoginHandlerDirectDefaultResponse() throws Exception {
 formLoginHandler = FormLoginHandler.create(authProvider);
 usernameParam = "username2";
 passwordParam ="password2";
 formLoginHandler.setUsernameParam(usernameParam).setPasswordParam(passwordParam);
 router.route().handler(LoggerHandler.create());
 router.route().handler(BodyHandler.create());
 router.route().handler(CookieHandler.create());
 router.route("/login").handler(formLoginHandler);
 testRequest(HttpMethod.POST, "/login", sendLoginRequestConsumer(), resp -> {
 }, 200, "OK", "<html><body><h1>Login successful</h1></body></html>");
}
origin: io.vertx/vertx-web

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);
}
origin: io.vertx/vertx-web

router.route("/login").handler(FormLoginHandler.create(authProvider));
origin: io.vertx/vertx-web

@Test
public void testFormLoginHandlerDirectSpecifyLoggedInURL() throws Exception {
 formLoginHandler = FormLoginHandler.create(authProvider);
 usernameParam = "username2";
 passwordParam ="password2";
 String loggedInDirectOKPage = "/youloggedinokpage.html";
 formLoginHandler.setUsernameParam(usernameParam).setPasswordParam(passwordParam).setDirectLoggedInOKURL(loggedInDirectOKPage);
 router.route().handler(LoggerHandler.create());
 router.route().handler(BodyHandler.create());
 router.route().handler(CookieHandler.create());
 router.route("/login").handler(formLoginHandler);
 testRequest(HttpMethod.POST, "/login", sendLoginRequestConsumer(), resp -> {
  String location = resp.headers().get("location");
  assertNotNull(location);
  assertEquals(loggedInDirectOKPage, location);
 }, 302, "Found", null);
}
io.vertx.ext.web.handlerFormLoginHandlercreate

Javadoc

Create a handler

Popular methods of FormLoginHandler

  • setDirectLoggedInOKURL
    Set the url to redirect to if the user logs in directly at the url of the form login handler without
  • setPasswordParam
    Set the name of the form param used to submit the password
  • setUsernameParam
    Set the name of the form param used to submit the username
  • handle
  • setReturnURLParam
    Set the name of the session attrioute used to specify the return url

Popular in Java

  • Start an intent from android
  • getSystemService (Context)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • onRequestPermissionsResult (Fragment)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • Stack (java.util)
    The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with
  • Join (org.hibernate.mapping)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now