IndieWeb.Auth.Code (IndieWeb v0.0.49) View Source
Handles authentication codes for the IndieAuth flow.
Link to this section Summary
Functions
Provides the age, in seconds, of a code.
Destroys all codes associated with the provided parameters.
Generates a code for IndieAuth based on the client_id, redirect_uri and any other extra parameters.
Generates a PKCE-compatible challenge string for the provided parameters.
Stores a code for later verification.
Verifies a code with the provided fields.
Link to this section Functions
Specs
age(keyword()) :: non_neg_integer()
Provides the age, in seconds, of a code.
Specs
Destroys all codes associated with the provided parameters.
Specs
Generates a code for IndieAuth based on the client_id, redirect_uri and any other extra parameters.
generate_challenge(client_id, redirect_uri, data \\ %{}, options \\ [])
View SourceSpecs
Generates a PKCE-compatible challenge string for the provided parameters.
persist(code, client_id, redirect_uri, params \\ %{}, options \\ [])
View SourceSpecs
Stores a code for later verification.
Provided a code
, a client's ID client_id
, the URL that this should redirect
to redirect_uri
as well as any arguments used to craft this authorization request in params
, store said code and references to for later verification.
verify(code, client_id, redirect_uri, params \\ %{}, options \\ [])
View SourceSpecs
Verifies a code with the provided fields.
Confirms that a code code
was created for the provided client's ID client_id
,
the URL that this should redirect to redirect_uri
as well as any arguments used
to craft this authorization request in params
.