Backplane.Oauth.Codes behaviour (backplane_oauth v1.10.77)

Copy Markdown View Source

Code context

Summary

Callbacks

Persists a token according to given params.

Returns a Backplane.Oauth.Token by value and redirect_uri.

Revokes the given Backplane.Oauth.Token code.

Revokes the the previouly issued token given Backplane.Oauth.Token code.

Callbacks

create(params)

@callback create(
  params :: %{
    client: Backplane.Oauth.Client.t(),
    sub: String.t(),
    redirect_uri: String.t(),
    scope: String.t(),
    state: String.t(),
    code_challenge: String.t(),
    code_challenge_method: String.t(),
    resource_owner: Backplane.Oauth.ResourceOwner.t()
  }
) :: code :: Backplane.Oauth.Token.t() | {:error, reason :: term()}

Persists a token according to given params.

get_by(params)

@callback get_by(params :: [value: String.t(), redirect_uri: String.t()]) ::
  token :: Backplane.Oauth.Token | nil

Returns a Backplane.Oauth.Token by value and redirect_uri.

revoke(token)

@callback revoke(token :: Backplane.Oauth.Token.t()) ::
  {:ok, Backplane.Oauth.Token.t()} | {:error, reason :: term()}

Revokes the given Backplane.Oauth.Token code.

revoke_previous_token(token)

@callback revoke_previous_token(token :: Backplane.Oauth.Token.t()) ::
  {:ok, Backplane.Oauth.Token.t()} | {:error, reason :: term()}

Revokes the the previouly issued token given Backplane.Oauth.Token code.