io.vertx.ext.auth.oauth2

## Interface OAuth2Auth

- All Superinterfaces:
    AuthProvider

      public interface OAuth2Auth
      extends AuthProvider

  Factory interface for creating OAuth2 based `AuthProvider` instances.
  Author:
    Paulo Lopes

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `authorizeURL(JsonObject params)` Generate a redirect URL to the authN/Z backend.
    `static OAuth2Auth` | `create(Vertx vertx)` Create a OAuth2 auth provider
    `static OAuth2Auth` | `create(Vertx vertx, OAuth2ClientOptions config)` Create a OAuth2 auth provider
    `static OAuth2Auth` | `create(Vertx vertx, OAuth2FlowType flow)` Deprecated. the flow configuration should be passed in the config object
    `static OAuth2Auth` | `create(Vertx vertx, OAuth2FlowType flow, OAuth2ClientOptions config)` Deprecated. the flow configuration should be passed in the config object
    `static OAuth2Auth` | `createKeycloak(Vertx vertx, OAuth2FlowType flow, JsonObject config)` Deprecated. You should use the provider helper `KeycloakAuth` instead. Create a OAuth2 auth provider
    `OAuth2Auth` | `decodeToken(String token, Handler<AsyncResult<AccessToken>> handler)` Deprecated. use `AuthProvider.authenticate(JsonObject, Handler)` instead.
    `OAuth2FlowType` | `getFlowType()` Deprecated.
    `String` | `getScopeSeparator()` Deprecated.
    `void` | `getToken(JsonObject params, Handler<AsyncResult<AccessToken>> handler)` Deprecated. use `AuthProvider.authenticate(JsonObject, Handler)` instead.
    `default OAuth2Auth` | `introspectToken(String token, Handler<AsyncResult<AccessToken>> handler)` Deprecated.
    `OAuth2Auth` | `introspectToken(String token, String tokenType, Handler<AsyncResult<AccessToken>> handler)` Deprecated.
    `OAuth2Auth` | `loadJWK(Handler<AsyncResult<Void>> handler)` Deprecated.
    `OAuth2Auth` | `missingKeyHandler(Handler<String> handler)` Handled to be called when a key (mentioned on a JWT) is missing from the current config.
    `OAuth2Auth` | `rbacHandler(OAuth2RBAC rbac)` Deprecated.

    - ### Methods inherited from interface io.vertx.ext.auth.AuthProvider

      `authenticate`

- - ### Method Detail

    - #### createKeycloak

          @Deprecated
          static OAuth2Auth createKeycloak(Vertx vertx,
                                                       OAuth2FlowType flow,
                                                       JsonObject config)

      Deprecated. You should use the provider helper `KeycloakAuth` instead. Create a OAuth2 auth provider
      Parameters:
        `vertx` - the Vertx instance
        `config` - the config as exported from the admin console
      Returns:
        the auth provider

    - #### create

          @Deprecated
          static OAuth2Auth create(Vertx vertx,
                                               OAuth2FlowType flow,
                                               OAuth2ClientOptions config)

      Deprecated. the flow configuration should be passed in the config object
      Create a OAuth2 auth provider
      Parameters:
        `vertx` - the Vertx instance
        `config` - the config
      Returns:
        the auth provider

    - #### create

          @Deprecated
          static OAuth2Auth create(Vertx vertx,
                                               OAuth2FlowType flow)

      Deprecated. the flow configuration should be passed in the config object
      Create a OAuth2 auth provider
      Parameters:
        `vertx` - the Vertx instance
      Returns:
        the auth provider

    - #### create

          static OAuth2Auth create(Vertx vertx)

      Create a OAuth2 auth provider
      Parameters:
        `vertx` - the Vertx instance
      Returns:
        the auth provider

    - #### create

          static OAuth2Auth create(Vertx vertx,
                                   OAuth2ClientOptions config)

      Create a OAuth2 auth provider
      Parameters:
        `vertx` - the Vertx instance
        `config` - the config
      Returns:
        the auth provider

    - #### authorizeURL

          String authorizeURL(JsonObject params)

      Generate a redirect URL to the authN/Z backend. It only applies to auth_code flow.

    - #### getToken

          @Deprecated
          void getToken(JsonObject params,
                                    Handler<AsyncResult<AccessToken>> handler)

      Deprecated. use `AuthProvider.authenticate(JsonObject, Handler)` instead.
      Returns the Access Token object.
      Parameters:
        `params` - - JSON with the options, each flow requires different options.
        `handler` - - The handler returning the results.

    - #### decodeToken

          @Deprecated
          OAuth2Auth decodeToken(String token,
                                             Handler<AsyncResult<AccessToken>> handler)

      Deprecated. use `AuthProvider.authenticate(JsonObject, Handler)` instead.
      Decode a token to a `AccessToken` object. This is useful to handle bearer JWT tokens.
      Parameters:
        `token` - the access token (base64 string)
        `handler` - A handler to receive the event
      Returns:
        self

    - #### introspectToken

          @Deprecated
          default OAuth2Auth introspectToken(String token,
                                                         Handler<AsyncResult<AccessToken>> handler)

      Deprecated.
      Query an OAuth 2.0 authorization server to determine the active state of an OAuth 2.0 token and to determine meta-information about this token.
      Parameters:
        `token` - the access token (base64 string)
        `handler` - A handler to receive the event
      Returns:
        self

    - #### introspectToken

          @Deprecated
          OAuth2Auth introspectToken(String token,
                                                 String tokenType,
                                                 Handler<AsyncResult<AccessToken>> handler)

      Deprecated.
      Query an OAuth 2.0 authorization server to determine the active state of an OAuth 2.0 token and to determine meta-information about this token.
      Parameters:
        `token` - the access token (base64 string)
        `tokenType` - hint to the token type e.g.: `access_token`
        `handler` - A handler to receive the event
      Returns:
        self

    - #### getScopeSeparator

          @Deprecated
          String getScopeSeparator()

      Deprecated.
      Returns the scope separator. The RFC 6749 states that a scope is expressed as a set of case-sensitive and space-delimited strings, however vendors tend not to agree on this and we see the following cases being used: space, plus sign, comma.
      Returns:
        what value was used in the configuration of the object, falling back to the default value which is a space.

    - #### getFlowType

          @Deprecated
          OAuth2FlowType getFlowType()

      Deprecated.
      Returns the configured flow type for the Oauth2 provider.
      Returns:
        the flow type.

    - #### loadJWK

          @Deprecated
          OAuth2Auth loadJWK(Handler<AsyncResult<Void>> handler)

      Deprecated.
      Loads a JWK Set from the remote provider. When calling this method several times, the loaded JWKs are updated in the underlying JWT object.

    - #### rbacHandler

          @Deprecated
          OAuth2Auth rbacHandler(OAuth2RBAC rbac)

      Deprecated.

    - #### missingKeyHandler

          OAuth2Auth missingKeyHandler(Handler<String> handler)

      Handled to be called when a key (mentioned on a JWT) is missing from the current config. Users are advised to call `loadJWK(Handler)` but being careful to implement some rate limiting function. This method isn't generic for several reasons. The provider is not aware of the capabilities of the backend IdP in terms of max allowed API calls. Some validation could be done at the key id, which only the end user is aware of.
      Returns:
        Future result.
      See Also:
        `missingKeyHandler(Handler)`

Copyright © 2021 Eclipse. All rights reserved.