Class OAuth2WebClient

java.lang.Object
io.vertx.reactivex.ext.web.client.WebClient
io.vertx.reactivex.ext.web.client.OAuth2WebClient
All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate

public class OAuth2WebClient extends WebClient implements io.vertx.lang.rx.RxDelegate
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

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

  • Field Details

    • __TYPE_ARG

      public static final io.vertx.lang.rx.TypeArg<OAuth2WebClient> __TYPE_ARG
  • Constructor Details

    • OAuth2WebClient

      public OAuth2WebClient(OAuth2WebClient delegate)
    • OAuth2WebClient

      public OAuth2WebClient(Object delegate)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class WebClient
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class WebClient
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class WebClient
    • getDelegate

      public OAuth2WebClient getDelegate()
      Specified by:
      getDelegate in interface io.vertx.lang.rx.RxDelegate
      Overrides:
      getDelegate in class WebClient
    • create

      public 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

      public 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
    • getUser

      public 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
    • withCredentials

      public OAuth2WebClient withCredentials(Credentials credentials)
      Mark that request should be dispatched with authentication obtained from passed OAuth2Auth provider
      Parameters:
      credentials -
      Returns:
      a reference to this, so the API can be used fluently
    • newInstance

      public static OAuth2WebClient newInstance(OAuth2WebClient arg)