Class UserContext
- All Implemented Interfaces:
MutinyDelegate
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()- 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 Mutiny-ified interface.
- See Also:
-
UserContext
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUserContext(io.vertx.ext.web.UserContext delegate) Create a new instance ofUserContextdelegating to the given (non-null) instance ofUserContext.UserContext(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidclear()Clear can be called from any route handler which needs to terminate a login session.booleanget()Get the authenticated user (if any).io.vertx.ext.web.UserContextGet the delegate instance.inthashCode()io.smallrye.mutiny.Uni<Void>Impersonates a second identity.io.smallrye.mutiny.Uni<Void>impersonate(String redirectUri) Impersonates a second identity.voidImpersonates a second identity.voidimpersonateAndAwait(String redirectUri) Impersonates a second identity.Impersonates a second identity.impersonateAndForget(String redirectUri) Impersonates a second identity.When performing a web identity operation, hint if possible to the identity provider to use the given login.io.smallrye.mutiny.Uni<Void>logout()Logout can be called from any route handler which needs to terminate a login session.io.smallrye.mutiny.Uni<Void>Logout can be called from any route handler which needs to terminate a login session.voidLogout can be called from any route handler which needs to terminate a login session.voidlogoutAndAwait(String redirectUri) Logout can be called from any route handler which needs to terminate a login session.Logout can be called from any route handler which needs to terminate a login session.logoutAndForget(String redirectUri) Logout can be called from any route handler which needs to terminate a login session.static UserContextnewInstance(io.vertx.ext.web.UserContext delegate) Creates a new instance of theUserContext.io.smallrye.mutiny.Uni<Void>refresh()Forces the current user to re-authenticate.io.smallrye.mutiny.Uni<Void>Forces the current user to re-authenticate.voidForces the current user to re-authenticate.voidrefreshAndAwait(String redirectUri) Forces the current user to re-authenticate.Forces the current user to re-authenticate.refreshAndForget(String redirectUri) Forces the current user to re-authenticate.io.smallrye.mutiny.Uni<Void>restore()Undo a previous call to a impersonation.io.smallrye.mutiny.Uni<Void>Undo a previous call to an impersonation.voidUndo a previous call to a impersonation.voidrestoreAndAwait(String redirectUri) Undo a previous call to an impersonation.Undo a previous call to a impersonation.restoreAndForget(String redirectUri) Undo a previous call to an impersonation.toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
UserContext
public UserContext(io.vertx.ext.web.UserContext delegate) Create a new instance ofUserContextdelegating to the given (non-null) instance ofUserContext. -
UserContext
-
-
Method Details
-
getDelegate
public io.vertx.ext.web.UserContext getDelegate()Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate instance
-
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.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
UserContext.refresh()
-
refreshAndAwait
public void refreshAndAwait()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.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- See Also:
-
UserContext.refresh()
-
refreshAndForget
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.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
UserContext.refresh()
-
refresh
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.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
redirectUri- the uri to redirect the user to after the re-authentication.- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
UserContext.refresh(String)
-
refreshAndAwait
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.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
redirectUri- the uri to redirect the user to after the re-authentication.- See Also:
-
UserContext.refresh(String)
-
refreshAndForget
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.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
redirectUri- the uri to redirect the user to after the re-authentication.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
UserContext.refresh(String)
-
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.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
UserContext.impersonate()
-
impersonateAndAwait
public void impersonateAndAwait()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.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- See Also:
-
UserContext.impersonate()
-
impersonateAndForget
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.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
UserContext.impersonate()
-
impersonate
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.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
redirectUri- the uri to redirect the user to after the authentication.- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
UserContext.impersonate(String)
-
impersonateAndAwait
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.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
redirectUri- the uri to redirect the user to after the authentication.- See Also:
-
UserContext.impersonate(String)
-
impersonateAndForget
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.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
redirectUri- the uri to redirect the user to after the authentication.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
UserContext.impersonate(String)
-
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.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
UserContext.restore()
-
restoreAndAwait
public void restoreAndAwait()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.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- See Also:
-
UserContext.restore()
-
restoreAndForget
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.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
UserContext.restore()
-
restore
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.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
redirectUri- the uri to redirect the user to after the re-authentication.- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
UserContext.restore(String)
-
restoreAndAwait
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.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
redirectUri- the uri to redirect the user to after the re-authentication.- See Also:
-
UserContext.restore(String)
-
restoreAndForget
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.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
redirectUri- the uri to redirect the user to after the re-authentication.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
UserContext.restore(String)
-
logout
Logout 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. Followed by a redirect to the given uri.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
redirectUri- the uri to redirect the user to after the logout.- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
UserContext.logout(String)
-
logoutAndAwait
Logout 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. Followed by a redirect to the given uri.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
redirectUri- the uri to redirect the user to after the logout.- See Also:
-
UserContext.logout(String)
-
logoutAndForget
Logout 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. Followed by a redirect to the given uri.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
redirectUri- the uri to redirect the user to after the logout.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
UserContext.logout(String)
-
logout
Logout 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. Followed by a redirect to/.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
UserContext.logout()
-
logoutAndAwait
public void logoutAndAwait()Logout 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. Followed by a redirect to/.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- See Also:
-
UserContext.logout()
-
logoutAndForget
Logout 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. Followed by a redirect to/.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
UserContext.logout()
-
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
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
-
clear
public void clear() -
newInstance
Creates a new instance of theUserContext. -
hashCode
public int hashCode() -
equals
-
toString
-