Package io.vertx.ext.web.client

## Interface OAuth2WebClient

- All Superinterfaces:
    `WebClient`

      public interface OAuth2WebClient
      extends WebClient

  An asynchronous OAuth2/OIDC aware HTTP / HTTP/2 client called `WebClientOAuth2`.

  This client wraps a `WebClient` and makes it session aware adding features to it:

  - Request an `access_token` if no user is created
  - Refresh `access_token` if current user is expired

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static OAuth2WebClient` | `create​(WebClient webClient, OAuth2Auth oAuth2Auth)` | Create a session aware web client using the provided `webClient` instance.
    `static OAuth2WebClient` | `create​(WebClient webClient, OAuth2Auth oAuth2Auth, OAuth2WebClientOptions options)` | Create a session aware web client using the provided `webClient` instance.
    `User` | `getUser()` | Get the authenticated user (if any) that is associated with this client.
    `OAuth2WebClient` | `withCredentials​(Credentials credentials)` | Mark that request should be dispatched with authentication obtained from passed `OAuth2Auth` provider

    - ### Methods inherited from interface io.vertx.ext.web.client.WebClient

      `close, delete, delete, delete, delete, delete, delete, deleteAbs, deleteAbs, get, get, get, get, get, get, getAbs, getAbs, head, head, head, head, head, head, headAbs, headAbs, patch, patch, patch, patch, patch, patch, patchAbs, patchAbs, post, post, post, post, post, post, postAbs, postAbs, put, put, put, put, put, put, putAbs, putAbs, request, request, request, request, request, request, request, request, request, request, request, request, request, request, requestAbs, requestAbs, requestAbs, requestAbs, updateSSLOptions, updateSSLOptions`

- - ### Method Detail

    - #### create

          static OAuth2WebClient create​(WebClient webClient,
                                        OAuth2Auth oAuth2Auth)

      Create a session aware web client using the provided `webClient` instance.
      Parameters:
        `webClient` - the web client instance
        `oAuth2Auth` - Configured oAuth2Auth provider to be used when `withCredentials(Credentials)` used
      Returns:
        the created client

    - #### create

          static OAuth2WebClient create​(WebClient webClient,
                                        OAuth2Auth oAuth2Auth,
                                        OAuth2WebClientOptions options)

      Create a session aware web client using the provided `webClient` instance.
      Parameters:
        `webClient` - the web client instance
        `oAuth2Auth` - Configured oAuth2Auth provider to be used when `withCredentials(Credentials)` used
        `options` - extra configuration for this object
      Returns:
        the created client

    - #### withCredentials

          OAuth2WebClient withCredentials​(Credentials credentials)

      Mark that request should be dispatched with authentication obtained from passed `OAuth2Auth` provider
      Returns:
        a reference to this, so the API can be used fluently

    - #### getUser

          User getUser()

      Get the authenticated user (if any) that is associated with this client.
      Returns:
        the current user associated with this client or null if no user is associated