Lithic.Resources.AuthStreamAccess (Lithic v1.0.0)

Copy Markdown View Source

Auth Stream Access (ASA) — subscribe to real-time authorization events.

ASA lets you run your own external authorization logic. Lithic calls your webhook endpoint for every authorization request, and you respond with an approve/decline decision within the timeout window.

HMAC Verification

Use Lithic.Webhook.verify/4 with the secret from get_secret/1 to verify incoming ASA requests.

Responding to Authorization Challenges

Lithic.AuthStreamAccess.respond_to_challenge(
  "challenge_token",
  %{result: "APPROVED"}
)

Summary

Functions

Check the enrollment status of a responder endpoint.

Disenroll from ASA webhooks.

Enroll a responder endpoint for ASA webhooks.

Retrieve the HMAC secret for verifying ASA webhook requests.

Respond to an Authorization Challenge (step-up auth).

Rotate the HMAC secret. Previous secret remains valid for 24h.

Functions

check_enrollment(opts \\ [])

@spec check_enrollment(keyword()) :: {:ok, map()} | {:error, Lithic.Error.t()}

Check the enrollment status of a responder endpoint.

disenroll(opts \\ [])

@spec disenroll(keyword()) :: {:ok, map()} | {:error, Lithic.Error.t()}

Disenroll from ASA webhooks.

enroll(params, opts \\ [])

@spec enroll(
  map(),
  keyword()
) :: {:ok, map()} | {:error, Lithic.Error.t()}

Enroll a responder endpoint for ASA webhooks.

get_secret(opts \\ [])

@spec get_secret(keyword()) :: {:ok, map()} | {:error, Lithic.Error.t()}

Retrieve the HMAC secret for verifying ASA webhook requests.

respond_to_challenge(challenge_token, params, opts \\ [])

@spec respond_to_challenge(String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Lithic.Error.t()}

Respond to an Authorization Challenge (step-up auth).

rotate_secret(opts \\ [])

@spec rotate_secret(keyword()) :: {:ok, map()} | {:error, Lithic.Error.t()}

Rotate the HMAC secret. Previous secret remains valid for 24h.