Class OAuth2RBAC


  • public class OAuth2RBAC
    extends Object
    Functional interface that allows users to implement custom RBAC verifiers for OAuth2/OpenId Connect. Users are to implement the isAuthorized method to verify authorities. For provides that do not export the permissions/roles in the token, this interface allows you to communicate with 3rd party services such as graph APIs to collect the required data. The contract is that once an authority is checked for a given user, it's value is cached during the execution of the request. If a user is stored to a persistent storage, or the token is introspected, the cache is cleared and a new call will be handled to the implementation.

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

    • Constructor Detail

      • OAuth2RBAC

        public OAuth2RBAC​(io.vertx.ext.auth.oauth2.OAuth2RBAC delegate)
      • OAuth2RBAC

        public OAuth2RBAC​(Object delegate)
    • Method Detail

      • getDelegate

        public io.vertx.ext.auth.oauth2.OAuth2RBAC getDelegate()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • isAuthorized

        @Deprecated
        public io.smallrye.mutiny.Uni<Boolean> isAuthorized​(AccessToken user,
                                                            String authority)
        Deprecated.
        This method should verify if the user has the given authority and return either a boolean value or an error. Note that false and errors are not the same. A user might not have a given authority but that doesn't mean that there was an error during the call.

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        user - the given user to assert on
        authority - the authority to lookup
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • isAuthorizedAndAwait

        @Deprecated
        public Boolean isAuthorizedAndAwait​(AccessToken user,
                                            String authority)
        Deprecated.
        Blocking variant of isAuthorized(io.vertx.mutiny.ext.auth.oauth2.AccessToken,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:
        user - the given user to assert on
        authority - the authority to lookup
        Returns:
        the Boolean instance produced by the operation.
      • newInstance

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