Package io.vertx.rxjava.ext.web
Class UserContext
- java.lang.Object
-
- io.vertx.rxjava.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
original
non 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 boolean
authenticated()
void
clear()
Clear can be called from any route handler which needs to terminate a login session.boolean
equals(Object o)
User
get()
Get the authenticated user (if any).UserContext
getDelegate()
int
hashCode()
void
impersonate()
void
impersonate(Handler<AsyncResult<Void>> callback)
void
impersonate(String redirectUri)
void
impersonate(String redirectUri, Handler<AsyncResult<Void>> callback)
UserContext
loginHint(String loginHint)
When performing a web identity operation, hint if possible to the identity provider to use the given login.void
logout()
void
logout(Handler<AsyncResult<Void>> callback)
void
logout(String redirectUri)
void
logout(String redirectUri, Handler<AsyncResult<Void>> callback)
static UserContext
newInstance(UserContext arg)
void
restore()
void
restore(Handler<AsyncResult<Void>> callback)
void
restore(String redirectUri)
void
restore(String redirectUri, Handler<AsyncResult<Void>> callback)
rx.Single<Void>
rxImpersonate()
rx.Single<Void>
rxImpersonate(String redirectUri)
rx.Single<Void>
rxLogout()
rx.Single<Void>
rxLogout(String redirectUri)
rx.Single<Void>
rxRestore()
rx.Single<Void>
rxRestore(String redirectUri)
String
toString()
-
-
-
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:
getDelegate
in 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 rx.Single<Void> rxImpersonate()
-
impersonate
public void impersonate(String redirectUri, Handler<AsyncResult<Void>> callback)
-
impersonate
public void impersonate(String redirectUri)
-
restore
public void restore(Handler<AsyncResult<Void>> callback)
-
restore
public void restore()
-
rxRestore
public rx.Single<Void> rxRestore()
-
restore
public void restore(String redirectUri, Handler<AsyncResult<Void>> callback)
-
restore
public void restore(String redirectUri)
-
logout
public void logout(String redirectUri, Handler<AsyncResult<Void>> callback)
-
logout
public void logout(String redirectUri)
-
logout
public void logout(Handler<AsyncResult<Void>> callback)
-
logout
public void logout()
-
rxLogout
public rx.Single<Void> rxLogout()
-
clear
public void clear()
Clear can be called from any route handler which needs to terminate a login session. Invoking logout will remove theUser
and 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)
-
-