View Source Lightning.AuthProviders.OAuthBehaviour behaviour (Lightning v2.10.4)

Defines a behaviour for OAuth providers within the Lightning application, specifying a common interface for OAuth operations. This interface ensures consistency and interoperability among different authentication providers (e.g., Google, Salesforce) by defining a set of required functions that each provider must implement.

Summary

Callbacks

Link to this callback

authorize_url(client, state, scopes, opts)

View Source
@callback authorize_url(
  client :: map(),
  state :: String.t(),
  scopes :: [String.t()],
  opts :: Keyword.t()
) :: String.t()
@callback build_client(opts :: Keyword.t()) :: {:ok, map()} | {:error, :invalid_config}
Link to this callback

get_token(client, wellknown_url, params)

View Source
@callback get_token(
  client :: map(),
  wellknown_url :: String.t() | nil,
  params :: map()
) :: {:ok, map()} | {:error, map()}
Link to this callback

get_userinfo(client, token, wellknown_url)

View Source
@callback get_userinfo(
  client :: map(),
  token :: map(),
  wellknown_url :: String.t()
) :: {:ok, map()} | {:error, map()}
Link to this callback

refresh_token(token, wellknown_url)

View Source
@callback refresh_token(
  token :: map(),
  wellknown_url :: String.t() | nil
) :: {:ok, map()} | {:error, map()}
Link to this callback

refresh_token(client, token, wellknown_url)

View Source
@callback refresh_token(
  client :: map(),
  token :: map(),
  wellknown_url :: String.t() | nil
) :: {:ok, map()} | {:error, map()}