Package io.vertx.reactivex.ext.web
Class UserContext
- java.lang.Object
-
- io.vertx.reactivex.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(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)- Require a re-authentication to switch user identitiesrestore(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)- De-escalate a previous impersonate calllogout(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)- 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()voidimpersonate()voidimpersonate(Handler<AsyncResult<Void>> callback)voidimpersonate(String redirectUri)voidimpersonate(String redirectUri, Handler<AsyncResult<Void>> callback)UserContextloginHint(String loginHint)When performing a web identity operation, hint if possible to the identity provider to use the given login.voidlogout()voidlogout(Handler<AsyncResult<Void>> callback)voidlogout(String redirectUri)voidlogout(String redirectUri, Handler<AsyncResult<Void>> callback)static UserContextnewInstance(UserContext arg)voidrestore()voidrestore(Handler<AsyncResult<Void>> callback)voidrestore(String redirectUri)voidrestore(String redirectUri, Handler<AsyncResult<Void>> callback)io.reactivex.CompletablerxImpersonate()io.reactivex.CompletablerxImpersonate(String redirectUri)io.reactivex.CompletablerxLogout()io.reactivex.CompletablerxLogout(String redirectUri)io.reactivex.CompletablerxRestore()io.reactivex.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 void impersonate(Handler<AsyncResult<Void>> callback)
-
impersonate
public void impersonate()
-
rxImpersonate
public io.reactivex.Completable rxImpersonate()
-
impersonate
public void impersonate(String redirectUri, Handler<AsyncResult<Void>> callback)
-
impersonate
public void impersonate(String redirectUri)
-
rxImpersonate
public io.reactivex.Completable rxImpersonate(String redirectUri)
-
restore
public void restore(Handler<AsyncResult<Void>> callback)
-
restore
public void restore()
-
rxRestore
public io.reactivex.Completable rxRestore()
-
restore
public void restore(String redirectUri, Handler<AsyncResult<Void>> callback)
-
restore
public void restore(String redirectUri)
-
rxRestore
public io.reactivex.Completable rxRestore(String redirectUri)
-
logout
public void logout(String redirectUri, Handler<AsyncResult<Void>> callback)
-
logout
public void logout(String redirectUri)
-
rxLogout
public io.reactivex.Completable rxLogout(String redirectUri)
-
logout
public void logout(Handler<AsyncResult<Void>> callback)
-
logout
public void logout()
-
rxLogout
public io.reactivex.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, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)no redirect will be performed.
-
newInstance
public static UserContext newInstance(UserContext arg)
-
-