Tabnine Logo
AuthProvider.rxAuthenticate
Code IndexAdd Tabnine 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 ArrayList()
  • Codota Iconnew LinkedList()
  • Smart code suggestions by Tabnine
}
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

  • Updating database using SQL prepared statement
  • getApplicationContext (Context)
  • compareTo (BigDecimal)
  • onRequestPermissionsResult (Fragment)
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • JPanel (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now