Class KeycloakAuth

java.lang.Object
io.vertx.mutiny.ext.auth.oauth2.providers.OpenIDConnectAuth
io.vertx.mutiny.ext.auth.oauth2.providers.KeycloakAuth
All Implemented Interfaces:
MutinyDelegate

public class KeycloakAuth extends OpenIDConnectAuth implements MutinyDelegate
Simplified factory to create an OAuth2Auth for Keycloak.

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

Author:
Paulo Lopes
See Also:
  • KeycloakAuth
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final TypeArg<KeycloakAuth>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    KeycloakAuth(io.vertx.ext.auth.oauth2.providers.KeycloakAuth delegate)
    Create a new instance of KeycloakAuth delegating to the given (non-null) instance of KeycloakAuth.
    KeycloakAuth(Object delegate)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static OAuth2Auth
    create(Vertx vertx, io.vertx.core.json.JsonObject config)
    Create a OAuth2Auth provider for Keycloak
    static OAuth2Auth
    create(Vertx vertx, io.vertx.core.json.JsonObject config, io.vertx.core.http.HttpClientOptions httpClientOptions)
    Create a OAuth2Auth provider for Keycloak
    static OAuth2Auth
    create(Vertx vertx, io.vertx.ext.auth.oauth2.OAuth2FlowType flow, io.vertx.core.json.JsonObject config)
    Create a OAuth2Auth provider for Keycloak
    static OAuth2Auth
    create(Vertx vertx, io.vertx.ext.auth.oauth2.OAuth2FlowType flow, io.vertx.core.json.JsonObject config, io.vertx.core.http.HttpClientOptions httpClientOptions)
    Create a OAuth2Auth provider for Keycloak
    static io.smallrye.mutiny.Uni<OAuth2Auth>
    discover(Vertx vertx, io.vertx.ext.auth.oauth2.OAuth2Options config)
    Create a OAuth2Auth provider for OpenID Connect Discovery.
    static OAuth2Auth
    discoverAndAwait(Vertx vertx, io.vertx.ext.auth.oauth2.OAuth2Options config)
    Create a OAuth2Auth provider for OpenID Connect Discovery.
    static void
    discoverAndForget(Vertx vertx, io.vertx.ext.auth.oauth2.OAuth2Options config)
    Create a OAuth2Auth provider for OpenID Connect Discovery.
    boolean
     
    io.vertx.ext.auth.oauth2.providers.KeycloakAuth
    Get the delegate instance.
    int
     
    newInstance(io.vertx.ext.auth.oauth2.providers.KeycloakAuth delegate)
    Creates a new instance of the KeycloakAuth.
     

    Methods inherited from class io.vertx.mutiny.ext.auth.oauth2.providers.OpenIDConnectAuth

    newInstance

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • KeycloakAuth

      public KeycloakAuth(io.vertx.ext.auth.oauth2.providers.KeycloakAuth delegate)
      Create a new instance of KeycloakAuth delegating to the given (non-null) instance of KeycloakAuth.
    • KeycloakAuth

      public KeycloakAuth(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.ext.auth.oauth2.providers.KeycloakAuth 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:
      getDelegate in interface MutinyDelegate
      Overrides:
      getDelegate in class OpenIDConnectAuth
      Returns:
      the delegate instance
    • discover

      @CheckReturnValue public static io.smallrye.mutiny.Uni<OAuth2Auth> discover(Vertx vertx, io.vertx.ext.auth.oauth2.OAuth2Options config)
      Create a OAuth2Auth provider for OpenID Connect Discovery. The discovery will use the default site in the configuration options and attempt to load the well known descriptor. If a site is provided (for example when running on a custom instance) that site will be used to do the lookup.

      If the discovered config includes a json web key url, it will be also fetched and the JWKs will be loaded into the OAuth provider so tokens can be decoded.

      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:
      vertx - the vertx instance
      config - the initial config
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KeycloakAuth#discover(Vertx, OAuth2Options, Handler)
      • io.vertx.ext.auth.oauth2.providers.KeycloakAuth#discover(Vertx, OAuth2Options)
    • discoverAndAwait

      public static OAuth2Auth discoverAndAwait(Vertx vertx, io.vertx.ext.auth.oauth2.OAuth2Options config)
      Create a OAuth2Auth provider for OpenID Connect Discovery. The discovery will use the default site in the configuration options and attempt to load the well known descriptor. If a site is provided (for example when running on a custom instance) that site will be used to do the lookup.

      If the discovered config includes a json web key url, it will be also fetched and the JWKs will be loaded into the OAuth provider so tokens can be decoded.

      Unlike the bare Vert.x variant, this method returns a OAuth2Auth. 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 a RuntimeException).

      Parameters:
      vertx - the vertx instance
      config - the initial config
      Returns:
      The operation result
      See Also:
      • KeycloakAuth#discover(Vertx, OAuth2Options, Handler)
      • io.vertx.ext.auth.oauth2.providers.KeycloakAuth#discover(Vertx, OAuth2Options)
    • discoverAndForget

      public static void discoverAndForget(Vertx vertx, io.vertx.ext.auth.oauth2.OAuth2Options config)
      Create a OAuth2Auth provider for OpenID Connect Discovery. The discovery will use the default site in the configuration options and attempt to load the well known descriptor. If a site is provided (for example when running on a custom instance) that site will be used to do the lookup.

      If the discovered config includes a json web key url, it will be also fetched and the JWKs will be loaded into the OAuth provider so tokens can be decoded.

      Unlike the bare Vert.x variant, this method ignores the OAuth2Auth result or any failure.

      Parameters:
      vertx - the vertx instance
      config - the initial config
      See Also:
      • KeycloakAuth#discover(Vertx, OAuth2Options, Handler)
      • io.vertx.ext.auth.oauth2.providers.KeycloakAuth#discover(Vertx, OAuth2Options)
    • create

      public static OAuth2Auth create(Vertx vertx, io.vertx.core.json.JsonObject config)
      Create a OAuth2Auth provider for Keycloak
      Parameters:
      config - the json config file exported from Keycloak admin console
    • create

      public static OAuth2Auth create(Vertx vertx, io.vertx.ext.auth.oauth2.OAuth2FlowType flow, io.vertx.core.json.JsonObject config)
      Create a OAuth2Auth provider for Keycloak
      Parameters:
      flow - the oauth2 flow to use
      config - the json config file exported from Keycloak admin console
    • create

      public static OAuth2Auth create(Vertx vertx, io.vertx.core.json.JsonObject config, io.vertx.core.http.HttpClientOptions httpClientOptions)
      Create a OAuth2Auth provider for Keycloak
      Parameters:
      config - the json config file exported from Keycloak admin console
      httpClientOptions - custom http client options
    • create

      public static OAuth2Auth create(Vertx vertx, io.vertx.ext.auth.oauth2.OAuth2FlowType flow, io.vertx.core.json.JsonObject config, io.vertx.core.http.HttpClientOptions httpClientOptions)
      Create a OAuth2Auth provider for Keycloak
      Parameters:
      flow - the oauth2 flow to use
      config - the json config file exported from Keycloak admin console
      httpClientOptions - custom http client options
    • newInstance

      public static KeycloakAuth newInstance(io.vertx.ext.auth.oauth2.providers.KeycloakAuth delegate)
      Creates a new instance of the KeycloakAuth.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class OpenIDConnectAuth
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class OpenIDConnectAuth
    • toString

      public String toString()
      Overrides:
      toString in class OpenIDConnectAuth