Sake.Auth.Consent behaviour (Sake v0.1.0)

Copy Markdown View Source

Renders the consent page and the authorization error page. The default, Sake.Auth.Consent.Default, ships its own small style sheet. A host replaces it with consent: MyAppWeb.MCPConsent in the auth config.

render/1 receives: client_name, client_host (nil when unknown), redirect_host, loopback?, subject_display, scopes ([{name, description}]), resource (the endpoint URL the token will be for), request (opaque, goes into a hidden field), action (the POST path), csrf_token (empty when the host runs no CSRF middleware), issuer_name. render_error/1 receives title, message, status.

A Sake.Auth.Consent struct is also a remembered approval of a client by a subject for one resource, held by Sake.Auth.Store.

Summary

Types

t()

@type t() :: %Sake.Auth.Consent{
  client_id: term(),
  inserted_at: term(),
  resource: term(),
  scopes: term(),
  subject_id: term()
}

Callbacks

render(map)

@callback render(map()) :: iodata()

render_error(map)

@callback render_error(map()) :: iodata()