java.lang.Object
org.apache.juneau.rest.auth.oauth.flow.Flows

public final class Flows extends Object
Helpers shared across all flow types.

Centralizes the Nimbus TokenRequest-to-OAuthToken round-trip plus the standard error mapping.

Since:
10.0.0
  • Method Details

    • send

      public static OAuthToken send(com.nimbusds.oauth2.sdk.TokenRequest req, Duration timeout, Consumer<com.nimbusds.oauth2.sdk.http.HTTPRequest> httpConfigurator)
      Sends the supplied TokenRequest via Nimbus's HTTP client and maps the response to OAuthToken.

      A finite connect/read timeout is applied BEFORE the caller's httpConfigurator runs, so an unresponsive IdP can never wedge the call indefinitely while still letting callers override the value.

      Parameters:
      req - The Nimbus TokenRequest. Never null.
      timeout - The connect/read timeout. null selects DEFAULT_HTTP_TIMEOUT.
      httpConfigurator - Optional pre-send hook on the HTTPRequest.
      Returns:
      The acquired token.
      Throws:
      OAuthFlowException - If the IdP returns an error or the HTTP round-trip fails.