Class AccessToken


  • public class AccessToken
    extends User
    AccessToken extension to the User interface

    NOTE: This class has been automatically generated from the original non Mutiny-ified interface using Vert.x codegen.

    • 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 class User
      • equals

        public boolean equals​(Object o)
        Overrides:
        equals in class User
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class User
      • 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 token

        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.
      • refreshAndAwait

        public Void refreshAndAwait()
        Blocking variant of refresh().

        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 of refresh() 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 from refresh() 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 token

        Unlike 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 of revoke(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 of revoke(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 from revoke(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 of logout().

        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 of logout() 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 from logout() 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 of introspect().

        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 of introspect() 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 from introspect() 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 of introspect(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 of introspect(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 from introspect(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 of userInfo().

        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 of userInfo() 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 from userInfo() 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 of fetch(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 of fetch(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 from fetch(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 of fetch(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.
      • newInstance

        public static AccessToken newInstance​(io.vertx.ext.auth.oauth2.AccessToken arg)