io.vertx.rxjava.ext.auth.oauth2

## Class OAuth2Auth

- java.lang.Object
- - io.vertx.rxjava.ext.auth.AuthProvider
  - - io.vertx.rxjava.ext.auth.oauth2.OAuth2Auth

-     public class OAuth2Auth
      extends AuthProvider

  Factory interface for creating OAuth2 based `AuthProvider` instances.

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

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `OAuth2Auth(OAuth2Auth delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `OAuth2Auth` | `api(HttpMethod method, String path, JsonObject params, Handler<AsyncResult<JsonObject>> handler)` Call OAuth2 APIs.
    `Observable<JsonObject>` | `apiObservable(HttpMethod method, String path, JsonObject params)` Call OAuth2 APIs.
    `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)` Create a OAuth2 auth provider
    `Object` | `getDelegate()`
    `void` | `getToken(JsonObject params, Handler<AsyncResult<AccessToken>> handler)` Returns the Access Token object.
    `Observable<AccessToken>` | `getTokenObservable(JsonObject params)` Returns the Access Token object.
    `boolean` | `hasJWTToken()` Returns true if this provider supports JWT tokens as the access_token.
    `static OAuth2Auth` | `newInstance(OAuth2Auth arg)`

    - ### Methods inherited from class io.vertx.rxjava.ext.auth.AuthProvider

      `authenticate, authenticateObservable, newInstance`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### OAuth2Auth

          public OAuth2Auth(OAuth2Auth delegate)

  - ### Method Detail

    - #### getDelegate

          public Object getDelegate()

      Overrides:
        `getDelegate` in class `AuthProvider`

    - #### createKeycloak

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

      Create a OAuth2 auth provider
      Parameters:
        `vertx` - the Vertx instance
        `flow` -
        `config` - the config as exported from the admin console
      Returns:
        the auth provider

    - #### create

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

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

    - #### create

          public static OAuth2Auth create(Vertx vertx,
                                          OAuth2FlowType flow)

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

    - #### authorizeURL

          public String authorizeURL(JsonObject params)

      Generate a redirect URL to the authN/Z backend. It only applies to auth_code flow.
      Parameters:
        `params` -
      Returns:

    - #### getToken

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

      Returns the Access Token object.
      Parameters:
        `params` - - JSON with the options, each flow requires different options.
        `handler` - - The handler returning the results.

    - #### getTokenObservable

          public Observable<AccessToken> getTokenObservable(JsonObject params)

      Returns the Access Token object.
      Parameters:
        `params` - - JSON with the options, each flow requires different options.
      Returns:

    - #### api

          public OAuth2Auth api(HttpMethod method,
                                String path,
                                JsonObject params,
                                Handler<AsyncResult<JsonObject>> handler)

      Call OAuth2 APIs.
      Parameters:
        `method` - HttpMethod
        `path` - target path
        `params` - parameters
        `handler` - handler
      Returns:
        self

    - #### apiObservable

          public Observable<JsonObject> apiObservable(HttpMethod method,
                                                      String path,
                                                      JsonObject params)

      Call OAuth2 APIs.
      Parameters:
        `method` - HttpMethod
        `path` - target path
        `params` - parameters
      Returns:

    - #### hasJWTToken

          public 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.

    - #### newInstance

          public static OAuth2Auth newInstance(OAuth2Auth arg)

Copyright © 2016. All rights reserved.