Interface IAuthClientHelper

All Known Implementing Classes:
AuthClientHelper

public interface IAuthClientHelper
Defines utility methods for handling authentication-related tasks. Implementations of this interface provide functionalities such as constructing HTTP request bodies, converting endpoint strings to URIs, and parsing authentication responses.
  • Method Details

    • convertEndpointStringToURI

      URI convertEndpointStringToURI(String tokenEndpoint)
      Converts a token endpoint URL string into a URI object.
      Parameters:
      tokenEndpoint - the token endpoint URL as a String.
      Returns:
      the corresponding URI object.
    • convertResponseToObject

      AccessToken convertResponseToObject(String responseBody)
      Converts a JSON response body into an AccessToken object.
      Parameters:
      responseBody - the JSON response body as a String.
      Returns:
      an AccessToken object created from the response body.
    • createRequestBody

      HttpRequest.BodyPublisher createRequestBody(String clientId, String clientSecret)
      Creates a request body for a client credentials grant type. The request body includes the client ID and client secret encoded as URL parameters.
      Parameters:
      clientId - the client ID as a String.
      clientSecret - the client secret as a String.
      Returns:
      a HttpRequest.BodyPublisher containing the request body.