Package io.vertx.rxjava3.ext.web
Class UserContext
- java.lang.Object
-
- io.vertx.rxjava3.ext.web.UserContext
-
public class UserContext extends Object
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 presentimpersonate()
- 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
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 io.vertx.lang.rx.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()
Completable
impersonate()
Impersonates a second identity.Completable
impersonate(String redirectUri)
Impersonates a second identity.UserContext
loginHint(String loginHint)
When performing a web identity operation, hint if possible to the identity provider to use the given login.Completable
logout()
Logout can be called from any route handler which needs to terminate a login session.Completable
logout(String redirectUri)
Logout can be called from any route handler which needs to terminate a login session.static UserContext
newInstance(UserContext arg)
Completable
refresh()
Forces the current user to re-authenticate.Completable
refresh(String redirectUri)
Forces the current user to re-authenticate.Completable
restore()
Undo a previous call to a impersonation.Completable
restore(String redirectUri)
Undo a previous call to an impersonation.Completable
rxImpersonate()
Impersonates a second identity.Completable
rxImpersonate(String redirectUri)
Impersonates a second identity.Completable
rxLogout()
Logout can be called from any route handler which needs to terminate a login session.Completable
rxLogout(String redirectUri)
Logout can be called from any route handler which needs to terminate a login session.Completable
rxRefresh()
Forces the current user to re-authenticate.Completable
rxRefresh(String redirectUri)
Forces the current user to re-authenticate.Completable
rxRestore()
Undo a previous call to a impersonation.Completable
rxRestore(String redirectUri)
Undo a previous call to an impersonation.String
toString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final io.vertx.lang.rx.TypeArg<UserContext> __TYPE_ARG
-
-
Constructor Detail
-
UserContext
public UserContext(UserContext delegate)
-
UserContext
public UserContext(Object delegate)
-
-
Method Detail
-
getDelegate
public UserContext getDelegate()
-
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 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 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 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 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 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 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 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 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 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 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 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 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 Completable logout(String redirectUri)
Logout 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. 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 Completable rxLogout(String redirectUri)
Logout 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. 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 Completable logout()
Logout 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. Followed by a redirect to/
.- Returns:
- future result of the operation.
-
rxLogout
public Completable rxLogout()
Logout 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. 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 theUser
and clear theSession
(if any) in the current context. Unlikelogout(java.lang.String)
no redirect will be performed.
-
newInstance
public static UserContext newInstance(UserContext arg)
-
-