Class AccessToken
- java.lang.Object
-
- io.vertx.mutiny.ext.auth.User
-
- io.vertx.mutiny.ext.auth.oauth2.AccessToken
-
public class AccessToken extends User
AccessToken extension to the User interface NOTE: This class has been automatically generated from theoriginal
non Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<AccessToken>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description AccessToken(io.vertx.ext.auth.oauth2.AccessToken delegate)
AccessToken(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.vertx.core.json.JsonObject
accessToken()
boolean
equals(Object o)
io.smallrye.mutiny.Uni<OAuth2Response>
fetch(io.vertx.core.http.HttpMethod method, String resource, io.vertx.core.json.JsonObject headers, Buffer payload)
Fetches a JSON resource using this Access Token.io.smallrye.mutiny.Uni<OAuth2Response>
fetch(String resource)
Fetches a JSON resource using this Access Token.OAuth2Response
fetchAndAwait(io.vertx.core.http.HttpMethod method, String resource, io.vertx.core.json.JsonObject headers, Buffer payload)
Blocking variant offetch(HttpMethod,String,JsonObject,io.vertx.mutiny.core.buffer.Buffer)
.OAuth2Response
fetchAndAwait(String resource)
Blocking variant offetch(String)
.AccessToken
fetchAndForget(io.vertx.core.http.HttpMethod method, String resource, io.vertx.core.json.JsonObject headers, Buffer payload)
Variant offetch(HttpMethod,String,JsonObject,io.vertx.mutiny.core.buffer.Buffer)
that ignores the result of the operation.AccessToken
fetchAndForget(String resource)
Variant offetch(String)
that ignores the result of the operation.io.vertx.ext.auth.oauth2.AccessToken
getDelegate()
int
hashCode()
io.vertx.core.json.JsonObject
idToken()
io.smallrye.mutiny.Uni<Void>
introspect()
Introspect access token.io.smallrye.mutiny.Uni<Void>
introspect(String tokenType)
Introspect access token.Void
introspectAndAwait()
Blocking variant ofintrospect()
.Void
introspectAndAwait(String tokenType)
Blocking variant ofintrospect(String)
.AccessToken
introspectAndForget()
Variant ofintrospect()
that ignores the result of the operation.AccessToken
introspectAndForget(String tokenType)
Variant ofintrospect(String)
that ignores the result of the operation.boolean
isScopeGranted()
io.smallrye.mutiny.Uni<Void>
logout()
Revoke refresh token and calls the logout endpoint.Void
logoutAndAwait()
Blocking variant oflogout()
.AccessToken
logoutAndForget()
Variant oflogout()
that ignores the result of the operation.static AccessToken
newInstance(io.vertx.ext.auth.oauth2.AccessToken arg)
String
opaqueAccessToken()
String
opaqueIdToken()
String
opaqueRefreshToken()
io.smallrye.mutiny.Uni<Void>
refresh()
Refresh the access tokenVoid
refreshAndAwait()
Blocking variant ofrefresh()
.AccessToken
refreshAndForget()
Variant ofrefresh()
that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>
revoke(String token_type)
Revoke access or refresh tokenVoid
revokeAndAwait(String token_type)
Blocking variant ofrevoke(String)
.AccessToken
revokeAndForget(String token_type)
Variant ofrevoke(String)
that ignores the result of the operation.AccessToken
setTrustJWT(boolean trust)
String
tokenType()
String
toString()
io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject>
userInfo()
Load the user info as per OIDC spec.io.vertx.core.json.JsonObject
userInfoAndAwait()
Blocking variant ofuserInfo()
.AccessToken
userInfoAndForget()
Variant ofuserInfo()
that ignores the result of the operation.-
Methods inherited from class io.vertx.mutiny.ext.auth.User
attributes, authorizations, clearCache, containsKey, create, create, expired, expired, fromName, fromToken, get, isAuthorized, isAuthorized, isAuthorizedAndAwait, isAuthorizedAndAwait, isAuthorizedAndForget, isAuthorizedAndForget, newInstance, principal, setAuthProvider
-
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<AccessToken> __TYPE_ARG
-
-
Constructor Detail
-
AccessToken
public AccessToken(io.vertx.ext.auth.oauth2.AccessToken delegate)
-
AccessToken
public AccessToken(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.ext.auth.oauth2.AccessToken getDelegate()
- Overrides:
getDelegate
in classUser
-
isScopeGranted
public boolean isScopeGranted()
- Returns:
-
accessToken
public io.vertx.core.json.JsonObject accessToken()
- Returns:
- JSON
-
idToken
public io.vertx.core.json.JsonObject idToken()
- Returns:
- JSON
-
opaqueAccessToken
public String opaqueAccessToken()
- Returns:
- String
-
opaqueRefreshToken
public String opaqueRefreshToken()
- Returns:
- String
-
opaqueIdToken
public String opaqueIdToken()
- Returns:
- String
-
tokenType
public String tokenType()
-
setTrustJWT
public AccessToken setTrustJWT(boolean trust)
-
refresh
public io.smallrye.mutiny.Uni<Void> refresh()
Refresh the access tokenUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
refreshAndAwait
public Void refreshAndAwait()
Blocking variant ofrefresh()
.This method waits 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 a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
refreshAndForget
public AccessToken refreshAndForget()
Variant ofrefresh()
that ignores the result of the operation.This method subscribes on the result of
refresh()
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromrefresh()
but you don't need to compose it with other operations.- Returns:
- the instance of AccessToken to chain method calls.
-
revoke
public io.smallrye.mutiny.Uni<Void> revoke(String token_type)
Revoke access or refresh tokenUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
token_type
- - A String containing the type of token to revoke. Should be either "access_token" or "refresh_token".- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
revokeAndAwait
public Void revokeAndAwait(String token_type)
Blocking variant ofrevoke(String)
.This method waits 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 a RuntimeException).
- Parameters:
token_type
- - A String containing the type of token to revoke. Should be either "access_token" or "refresh_token".- Returns:
- the Void instance produced by the operation.
-
revokeAndForget
public AccessToken revokeAndForget(String token_type)
Variant ofrevoke(String)
that ignores the result of the operation.This method subscribes on the result of
revoke(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromrevoke(String)
but you don't need to compose it with other operations.- Parameters:
token_type
- - A String containing the type of token to revoke. Should be either "access_token" or "refresh_token".- Returns:
- the instance of AccessToken to chain method calls.
-
logout
public io.smallrye.mutiny.Uni<Void> logout()
Revoke refresh token and calls the logout endpoint. This is a openid-connect extension and might not be available on all providers.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
logoutAndAwait
public Void logoutAndAwait()
Blocking variant oflogout()
.This method waits 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 a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
logoutAndForget
public AccessToken logoutAndForget()
Variant oflogout()
that ignores the result of the operation.This method subscribes on the result of
logout()
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromlogout()
but you don't need to compose it with other operations.- Returns:
- the instance of AccessToken to chain method calls.
-
introspect
public io.smallrye.mutiny.Uni<Void> introspect()
Introspect access token. This is an OAuth2 extension that allow to verify if an access token is still valid.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
introspectAndAwait
public Void introspectAndAwait()
Blocking variant ofintrospect()
.This method waits 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 a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
introspectAndForget
public AccessToken introspectAndForget()
Variant ofintrospect()
that ignores the result of the operation.This method subscribes on the result of
introspect()
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromintrospect()
but you don't need to compose it with other operations.- Returns:
- the instance of AccessToken to chain method calls.
-
introspect
public io.smallrye.mutiny.Uni<Void> introspect(String tokenType)
Introspect access token. This is an OAuth2 extension that allow to verify if an access token is still valid.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
tokenType
- - A String containing the type of token to revoke. Should be either "access_token" or "refresh_token".- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
introspectAndAwait
public Void introspectAndAwait(String tokenType)
Blocking variant ofintrospect(String)
.This method waits 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 a RuntimeException).
- Parameters:
tokenType
- - A String containing the type of token to revoke. Should be either "access_token" or "refresh_token".- Returns:
- the Void instance produced by the operation.
-
introspectAndForget
public AccessToken introspectAndForget(String tokenType)
Variant ofintrospect(String)
that ignores the result of the operation.This method subscribes on the result of
introspect(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromintrospect(String)
but you don't need to compose it with other operations.- Parameters:
tokenType
- - A String containing the type of token to revoke. Should be either "access_token" or "refresh_token".- Returns:
- the instance of AccessToken to chain method calls.
-
userInfo
public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject> userInfo()
Load the user info as per OIDC spec.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
userInfoAndAwait
public io.vertx.core.json.JsonObject userInfoAndAwait()
Blocking variant ofuserInfo()
.This method waits 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 a RuntimeException).
- Returns:
- the JsonObject instance produced by the operation.
-
userInfoAndForget
public AccessToken userInfoAndForget()
Variant ofuserInfo()
that ignores the result of the operation.This method subscribes on the result of
userInfo()
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromuserInfo()
but you don't need to compose it with other operations.- Returns:
- the instance of AccessToken to chain method calls.
-
fetch
public io.smallrye.mutiny.Uni<OAuth2Response> fetch(String resource)
Fetches a JSON resource using this Access Token.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
resource
- - the resource to fetch.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
fetchAndAwait
public OAuth2Response fetchAndAwait(String resource)
Blocking variant offetch(String)
.This method waits 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 a RuntimeException).
- Parameters:
resource
- - the resource to fetch.- Returns:
- the OAuth2Response instance produced by the operation.
-
fetchAndForget
public AccessToken fetchAndForget(String resource)
Variant offetch(String)
that ignores the result of the operation.This method subscribes on the result of
fetch(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromfetch(String)
but you don't need to compose it with other operations.- Parameters:
resource
- - the resource to fetch.- Returns:
- the instance of AccessToken to chain method calls.
-
fetch
public io.smallrye.mutiny.Uni<OAuth2Response> fetch(io.vertx.core.http.HttpMethod method, String resource, io.vertx.core.json.JsonObject headers, Buffer payload)
Fetches a JSON resource using this Access Token.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
method
- - the HTTP method to user.resource
- - the resource to fetch.headers
- - extra headers to pass to the request.payload
- - payload to send to the server.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
fetchAndAwait
public OAuth2Response fetchAndAwait(io.vertx.core.http.HttpMethod method, String resource, io.vertx.core.json.JsonObject headers, Buffer payload)
Blocking variant offetch(HttpMethod,String,JsonObject,io.vertx.mutiny.core.buffer.Buffer)
.This method waits 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 a RuntimeException).
- Parameters:
method
- - the HTTP method to user.resource
- - the resource to fetch.headers
- - extra headers to pass to the request.payload
- - payload to send to the server.- Returns:
- the OAuth2Response instance produced by the operation.
-
fetchAndForget
public AccessToken fetchAndForget(io.vertx.core.http.HttpMethod method, String resource, io.vertx.core.json.JsonObject headers, Buffer payload)
Variant offetch(HttpMethod,String,JsonObject,io.vertx.mutiny.core.buffer.Buffer)
that ignores the result of the operation.This method subscribes on the result of
fetch(HttpMethod,String,JsonObject,io.vertx.mutiny.core.buffer.Buffer)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromfetch(HttpMethod,String,JsonObject,io.vertx.mutiny.core.buffer.Buffer)
but you don't need to compose it with other operations.- Parameters:
method
- - the HTTP method to user.resource
- - the resource to fetch.headers
- - extra headers to pass to the request.payload
- - payload to send to the server.- Returns:
- the instance of AccessToken to chain method calls.
-
newInstance
public static AccessToken newInstance(io.vertx.ext.auth.oauth2.AccessToken arg)
-
-