Class UserContext

java.lang.Object
io.vertx.rxjava3.ext.web.UserContext
All Implemented Interfaces:
RxDelegate

public class UserContext extends Object implements RxDelegate
A web user is extended user coupled to the context and is used to perform verifications and actions on behalf of the user. Actions can be:
  • refresh() - Require a re-authentication to confirm the user is present
  • impersonate() - Require a re-authentication to switch user identities
  • restore() - De-escalate a previous impersonate call
  • logout(java.lang.String) - Logout the user from this application and redirect to a uri
  • clear() - Same as logout, without requirind a redirect

NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final TypeArg<UserContext>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    UserContext(Object delegate)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    void
    Clear can be called from any route handler which needs to terminate a login session.
    boolean
     
    get()
    Get the authenticated user (if any).
     
    int
     
    io.reactivex.rxjava3.core.Completable
    Impersonates a second identity.
    io.reactivex.rxjava3.core.Completable
    impersonate(String redirectUri)
    Impersonates a second identity.
    loginHint(String loginHint)
    When performing a web identity operation, hint if possible to the identity provider to use the given login.
    io.reactivex.rxjava3.core.Completable
    Logout can be called from any route handler which needs to terminate a login session.
    io.reactivex.rxjava3.core.Completable
    logout(String redirectUri)
    Logout can be called from any route handler which needs to terminate a login session.
     
    io.reactivex.rxjava3.core.Completable
    Forces the current user to re-authenticate.
    io.reactivex.rxjava3.core.Completable
    refresh(String redirectUri)
    Forces the current user to re-authenticate.
    io.reactivex.rxjava3.core.Completable
    Undo a previous call to a impersonation.
    io.reactivex.rxjava3.core.Completable
    restore(String redirectUri)
    Undo a previous call to an impersonation.
    io.reactivex.rxjava3.core.Completable
    Impersonates a second identity.
    io.reactivex.rxjava3.core.Completable
    rxImpersonate(String redirectUri)
    Impersonates a second identity.
    io.reactivex.rxjava3.core.Completable
    Logout can be called from any route handler which needs to terminate a login session.
    io.reactivex.rxjava3.core.Completable
    rxLogout(String redirectUri)
    Logout can be called from any route handler which needs to terminate a login session.
    io.reactivex.rxjava3.core.Completable
    Forces the current user to re-authenticate.
    io.reactivex.rxjava3.core.Completable
    rxRefresh(String redirectUri)
    Forces the current user to re-authenticate.
    io.reactivex.rxjava3.core.Completable
    Undo a previous call to a impersonation.
    io.reactivex.rxjava3.core.Completable
    rxRestore(String redirectUri)
    Undo a previous call to an impersonation.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • UserContext

      public UserContext(UserContext delegate)
    • UserContext

      public UserContext(Object delegate)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getDelegate

      public UserContext getDelegate()
      Specified by:
      getDelegate in interface RxDelegate
    • get

      public User get()
      Get the authenticated user (if any). This will usually be injected by an auth handler if authentication if successful.
      Returns:
      the user, or null if the current user is not authenticated.
    • authenticated

      public boolean authenticated()
    • loginHint

      public UserContext loginHint(String loginHint)
      When performing a web identity operation, hint if possible to the identity provider to use the given login.
      Parameters:
      loginHint - the desired login name, for example: admin.
      Returns:
      fluent self
    • refresh

      public io.reactivex.rxjava3.core.Completable refresh()
      Forces the current user to re-authenticate. The user will be redirected to the same origin where this call was made. It is important to notice that the redirect will only allow sources originating from a HTTP GET request.
      Returns:
      future result of the operation.
    • rxRefresh

      public io.reactivex.rxjava3.core.Completable rxRefresh()
      Forces the current user to re-authenticate. The user will be redirected to the same origin where this call was made. It is important to notice that the redirect will only allow sources originating from a HTTP GET request.
      Returns:
      future result of the operation.
    • refresh

      public io.reactivex.rxjava3.core.Completable refresh(String redirectUri)
      Forces the current user to re-authenticate. The user will be redirected to the given uri. It is important to notice that the redirect will only allow targets using an HTTP GET request.
      Parameters:
      redirectUri - the uri to redirect the user to after the re-authentication.
      Returns:
      future result of the operation.
    • rxRefresh

      public io.reactivex.rxjava3.core.Completable rxRefresh(String redirectUri)
      Forces the current user to re-authenticate. The user will be redirected to the given uri. It is important to notice that the redirect will only allow targets using an HTTP GET request.
      Parameters:
      redirectUri - the uri to redirect the user to after the re-authentication.
      Returns:
      future result of the operation.
    • impersonate

      public io.reactivex.rxjava3.core.Completable impersonate()
      Impersonates a second identity. The user will be redirected to the same origin where this call was made. It is important to notice that the redirect will only allow sources originating from a HTTP GET request.
      Returns:
      future result of the operation.
    • rxImpersonate

      public io.reactivex.rxjava3.core.Completable rxImpersonate()
      Impersonates a second identity. The user will be redirected to the same origin where this call was made. It is important to notice that the redirect will only allow sources originating from a HTTP GET request.
      Returns:
      future result of the operation.
    • impersonate

      public io.reactivex.rxjava3.core.Completable impersonate(String redirectUri)
      Impersonates a second identity. The user will be redirected to the given uri. It is important to notice that the redirect will only allow targets using an HTTP GET request.
      Parameters:
      redirectUri - the uri to redirect the user to after the authentication.
      Returns:
      future result of the operation.
    • rxImpersonate

      public io.reactivex.rxjava3.core.Completable rxImpersonate(String redirectUri)
      Impersonates a second identity. The user will be redirected to the given uri. It is important to notice that the redirect will only allow targets using an HTTP GET request.
      Parameters:
      redirectUri - the uri to redirect the user to after the authentication.
      Returns:
      future result of the operation.
    • restore

      public io.reactivex.rxjava3.core.Completable restore()
      Undo a previous call to a impersonation. The user will be redirected to the same origin where this call was made. It is important to notice that the redirect will only allow sources originating from a HTTP GET request.
      Returns:
      future result of the operation.
    • rxRestore

      public io.reactivex.rxjava3.core.Completable rxRestore()
      Undo a previous call to a impersonation. The user will be redirected to the same origin where this call was made. It is important to notice that the redirect will only allow sources originating from a HTTP GET request.
      Returns:
      future result of the operation.
    • restore

      public io.reactivex.rxjava3.core.Completable restore(String redirectUri)
      Undo a previous call to an impersonation. The user will be redirected to the given uri. It is important to notice that the redirect will only allow targets using an HTTP GET request.
      Parameters:
      redirectUri - the uri to redirect the user to after the re-authentication.
      Returns:
      future result of the operation.
    • rxRestore

      public io.reactivex.rxjava3.core.Completable rxRestore(String redirectUri)
      Undo a previous call to an impersonation. The user will be redirected to the given uri. It is important to notice that the redirect will only allow targets using an HTTP GET request.
      Parameters:
      redirectUri - the uri to redirect the user to after the re-authentication.
      Returns:
      future result of the operation.
    • logout

      public io.reactivex.rxjava3.core.Completable logout(String redirectUri)
      Logout can be called from any route handler which needs to terminate a login session. Invoking logout will remove the User and clear the Session (if any) in the current context. Followed by a redirect to the given uri.
      Parameters:
      redirectUri - the uri to redirect the user to after the logout.
      Returns:
      future result of the operation.
    • rxLogout

      public io.reactivex.rxjava3.core.Completable rxLogout(String redirectUri)
      Logout can be called from any route handler which needs to terminate a login session. Invoking logout will remove the User and clear the Session (if any) in the current context. Followed by a redirect to the given uri.
      Parameters:
      redirectUri - the uri to redirect the user to after the logout.
      Returns:
      future result of the operation.
    • logout

      public io.reactivex.rxjava3.core.Completable logout()
      Logout can be called from any route handler which needs to terminate a login session. Invoking logout will remove the User and clear the Session (if any) in the current context. Followed by a redirect to /.
      Returns:
      future result of the operation.
    • rxLogout

      public io.reactivex.rxjava3.core.Completable rxLogout()
      Logout can be called from any route handler which needs to terminate a login session. Invoking logout will remove the User and clear the Session (if any) in the current context. Followed by a redirect to /.
      Returns:
      future result of the operation.
    • clear

      public void clear()
      Clear can be called from any route handler which needs to terminate a login session. Invoking logout will remove the User and clear the Session (if any) in the current context. Unlike logout(java.lang.String) no redirect will be performed.
    • newInstance

      public static UserContext newInstance(UserContext arg)