Codota Logo
AuthProvider.rxAuthenticate
Code IndexAdd Codota to your IDE (free)

How to use
rxAuthenticate
method
in
io.vertx.reactivex.ext.auth.AuthProvider

Best Java code snippets using io.vertx.reactivex.ext.auth.AuthProvider.rxAuthenticate (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: FroMage/redpipe

@POST
@Path("/loginAuth")
public Single<Response> loginAuth(@FormParam("username") String username, @FormParam("password") String password,
    @FormParam("return_url") String returnUrl, @Context Session session, @Context RoutingContext ctx,
    @Context AuthProvider auth) throws URISyntaxException {
  if (username == null || username.isEmpty() || password == null || password.isEmpty())
    return Single.just(Response.status(Status.BAD_REQUEST).build());
  JsonObject authInfo = new JsonObject().put("username", username).put("password", password);
  return auth.rxAuthenticate(authInfo).map(user -> {
    ctx.setUser(user);
    if (session != null) {
      // the user has upgraded from unauthenticated to authenticated
      // session should be upgraded as recommended by owasp
      session.regenerateId();
    }
    String redirectUrl = session.remove(REDIRECT_KEY);
    if (redirectUrl == null)
      redirectUrl = returnUrl;
    if (redirectUrl == null)
      redirectUrl = "/";
    try {
      return Response.status(Status.FOUND).location(new URI(redirectUrl)).build();
    } catch (URISyntaxException e) {
      throw new RuntimeException(e);
    }
  }).onErrorReturn(t -> {
    return Response.status(Status.FORBIDDEN).entity(t.getMessage()).type(MediaType.TEXT_PLAIN).build();
  });
}
origin: net.redpipe/redpipe-engine

@POST
@Path("/loginAuth")
public Single<Response> loginAuth(@FormParam("username") String username, @FormParam("password") String password,
    @FormParam("return_url") String returnUrl, @Context Session session, @Context RoutingContext ctx,
    @Context AuthProvider auth) throws URISyntaxException {
  if (username == null || username.isEmpty() || password == null || password.isEmpty())
    return Single.just(Response.status(Status.BAD_REQUEST).build());
  JsonObject authInfo = new JsonObject().put("username", username).put("password", password);
  return auth.rxAuthenticate(authInfo).map(user -> {
    ctx.setUser(user);
    if (session != null) {
      // the user has upgraded from unauthenticated to authenticated
      // session should be upgraded as recommended by owasp
      session.regenerateId();
    }
    String redirectUrl = session.remove(REDIRECT_KEY);
    if (redirectUrl == null)
      redirectUrl = returnUrl;
    if (redirectUrl == null)
      redirectUrl = "/";
    try {
      return Response.status(Status.FOUND).location(new URI(redirectUrl)).build();
    } catch (URISyntaxException e) {
      throw new RuntimeException(e);
    }
  }).onErrorReturn(t -> {
    return Response.status(Status.FORBIDDEN).entity(t.getMessage()).type(MediaType.TEXT_PLAIN).build();
  });
}
origin: FroMage/redpipe

User user;
try {
  user = await(auth.rxAuthenticate(creds));
}catch(VertxException x) {
  return Response.status(Status.FORBIDDEN).build();
origin: FroMage/redpipe

User user;
try {
  user = await(auth.rxAuthenticate(creds));
}catch(VertxException x) {
  return Response.status(Status.FORBIDDEN).build();
io.vertx.reactivex.ext.authAuthProviderrxAuthenticate

Popular methods of AuthProvider

  • getDelegate
  • <init>
  • newInstance

Popular in Java

  • Running tasks concurrently on multiple threads
  • compareTo (BigDecimal)
  • getApplicationContext (Context)
  • getSystemService (Context)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • BigInteger (java.math)
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
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