Package io.vertx.rxjava3.ext.web
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:impersonate()- Require a re-authentication to switch user identitiesrestore()- De-escalate a previous impersonate calllogout(java.lang.String)- Logout the user from this application and redirect to a uriclear()- Same as logout, without requirind a redirect
originalnon RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<UserContext>__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description UserContext(UserContext delegate)UserContext(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanauthenticated()voidclear()Clear can be called from any route handler which needs to terminate a login session.booleanequals(Object o)Userget()Get the authenticated user (if any).UserContextgetDelegate()inthashCode()io.reactivex.rxjava3.core.Completableimpersonate()io.reactivex.rxjava3.core.Completableimpersonate(String redirectUri)UserContextloginHint(String loginHint)When performing a web identity operation, hint if possible to the identity provider to use the given login.io.reactivex.rxjava3.core.Completablelogout()io.reactivex.rxjava3.core.Completablelogout(String redirectUri)static UserContextnewInstance(UserContext arg)io.reactivex.rxjava3.core.Completablerestore()io.reactivex.rxjava3.core.Completablerestore(String redirectUri)io.reactivex.rxjava3.core.CompletablerxImpersonate()io.reactivex.rxjava3.core.CompletablerxImpersonate(String redirectUri)io.reactivex.rxjava3.core.CompletablerxLogout()io.reactivex.rxjava3.core.CompletablerxLogout(String redirectUri)io.reactivex.rxjava3.core.CompletablerxRestore()io.reactivex.rxjava3.core.CompletablerxRestore(String redirectUri)StringtoString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<UserContext> __TYPE_ARG
-
-
Constructor Detail
-
UserContext
public UserContext(UserContext delegate)
-
UserContext
public UserContext(Object delegate)
-
-
Method Detail
-
getDelegate
public UserContext getDelegate()
- Specified by:
getDelegatein interfaceRxDelegate
-
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
-
impersonate
public io.reactivex.rxjava3.core.Completable impersonate()
-
rxImpersonate
public io.reactivex.rxjava3.core.Completable rxImpersonate()
-
impersonate
public io.reactivex.rxjava3.core.Completable impersonate(String redirectUri)
-
rxImpersonate
public io.reactivex.rxjava3.core.Completable rxImpersonate(String redirectUri)
-
restore
public io.reactivex.rxjava3.core.Completable restore()
-
rxRestore
public io.reactivex.rxjava3.core.Completable rxRestore()
-
restore
public io.reactivex.rxjava3.core.Completable restore(String redirectUri)
-
rxRestore
public io.reactivex.rxjava3.core.Completable rxRestore(String redirectUri)
-
logout
public io.reactivex.rxjava3.core.Completable logout(String redirectUri)
-
rxLogout
public io.reactivex.rxjava3.core.Completable rxLogout(String redirectUri)
-
logout
public io.reactivex.rxjava3.core.Completable logout()
-
rxLogout
public io.reactivex.rxjava3.core.Completable rxLogout()
-
clear
public void clear()
Clear can be called from any route handler which needs to terminate a login session. Invoking logout will remove theUserand clear theSession(if any) in the current context. Unlikelogout(java.lang.String)no redirect will be performed.
-
newInstance
public static UserContext newInstance(UserContext arg)
-
-