io.vertx.ext.auth.oauth2

## Interface OAuth2Auth

- All Superinterfaces:
    AuthProvider, io.vertx.ext.auth.impl.AuthProviderInternal

      public interface OAuth2Auth
      extends io.vertx.ext.auth.impl.AuthProviderInternal

  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, OAuth2FlowType flow)` Create a OAuth2 auth provider
    `static OAuth2Auth` | `create(Vertx vertx, OAuth2FlowType flow, OAuth2ClientOptions config)` Create a OAuth2 auth provider
    `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)` Decode a token to a `AccessToken` object.
    `OAuth2FlowType` | `getFlowType()` Returns the configured flow type for the Oauth2 provider.
    `String` | `getScopeSeparator()` Returns the scope separator.
    `void` | `getToken(JsonObject params, Handler<AsyncResult<AccessToken>> handler)` Deprecated. use `AuthProvider.authenticate(JsonObject, Handler)` instead.
    `boolean` | `hasJWTToken()` Returns true if this provider supports JWT tokens as the access_token.
    `default OAuth2Auth` | `introspectToken(String token, Handler<AsyncResult<AccessToken>> handler)` 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.
    `OAuth2Auth` | `introspectToken(String token, String tokenType, Handler<AsyncResult<AccessToken>> handler)` 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.
    `default void` | `verifyIsUsingPassword()`

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

      `authenticate`

- - ### Method Detail

    - #### verifyIsUsingPassword

          default void verifyIsUsingPassword()

      Specified by:
        `verifyIsUsingPassword` in interface `io.vertx.ext.auth.impl.AuthProviderInternal`

    - #### 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

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

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

    - #### create

          static OAuth2Auth create(Vertx vertx,
                                   OAuth2FlowType flow)

      Create a OAuth2 auth provider
      Parameters:
        `vertx` - the Vertx instance
      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.

    - #### hasJWTToken

          boolean hasJWTToken()

      Returns true if this provider supports JWT tokens as the access_token. This is typically true if the provider implements the `openid-connect` protocol. This is a plain return from the config option jwtToken, which is false by default. This information is important to validate grants. Since pure OAuth2 should be used for authorization and when a token is requested all grants should be declared, in case of openid-connect this is not true. OpenId will issue a token and all grants will be encoded on the token itself so the requester does not need to list the required grants.
      Returns:
        true if openid-connect is used.

    - #### decodeToken

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

      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

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

      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

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

      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

          String getScopeSeparator()

      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

          OAuth2FlowType getFlowType()

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

Copyright © 2017. All rights reserved.