Arc.Identity.Provider behaviour (cratis_arc v0.1.0)

Copy Markdown View Source

Supplies the application-specific details of the signed-in user.

details/1 runs on every identity request, with a fresh Arc.Identity.Context. Cache expensive lookups inside it. It may return:

  • {:ok, details} - the user may enter; details is a map or an Arc.Schema struct
  • {:unauthorized, details} - the user is authenticated but may not use the application (403)
  • an Arc.Identity.Details struct, equivalent to the above

Use use Arc.Identity.Provider, details: MyApp.Details to declare the details type; Arc discovers the provider from its application modules. At most one provider may exist per application, or name one explicitly with the identity_details: option.

Summary

Callbacks

details(t)

@callback details(Arc.Identity.Context.t()) ::
  {:ok, term()} | {:unauthorized, term()} | Arc.Identity.Details.t()