CampaignFlow.Client.Auth (CampaignFlow Client v0.1.0)

View Source

Handles OAuth2 authentication for the Campaign Flow API.

This module manages OAuth2 client credentials flow for obtaining access tokens.

Summary

Functions

Builds the OAuth2 token URL from the base URL.

Obtains an access token using the OAuth2 client credentials flow.

Functions

build_token_url(base_url)

@spec build_token_url(String.t()) :: String.t()

Builds the OAuth2 token URL from the base URL.

get_access_token(client)

@spec get_access_token(CampaignFlow.Client.t()) ::
  {:ok, CampaignFlow.Client.t()} | {:error, term()}

Obtains an access token using the OAuth2 client credentials flow.

Returns an updated client struct with the access token and expiration time.