Boruta.Oauth.ResourceOwners behaviour (Boruta core v1.2.0) View Source

Resource owner context

Link to this section Summary

Callbacks

Returns a list of authorized scopes for a given resource owner. These scopes will be granted is requested for the user.

Determines if given password is correct.

Returns a resource owner by (username, password) or (id). Returns nil for non matching results.

Link to this section Callbacks

Link to this callback

authorized_scopes(resource_owner)

View Source

Specs

authorized_scopes(resource_owner :: Boruta.Oauth.ResourceOwner.t()) :: [
  Boruta.Oauth.Scope.t()
]

Returns a list of authorized scopes for a given resource owner. These scopes will be granted is requested for the user.

Link to this callback

check_password(resource_owner, password)

View Source

Specs

check_password(
  resource_owner :: Boruta.Oauth.ResourceOwner.t(),
  password :: String.t()
) :: :ok | {:error, String.t()}

Determines if given password is correct.

Specs

get_by([{:username, String.t()}] | [{:sub, String.t()}]) ::
  {:ok, resource_owner :: Boruta.Oauth.ResourceOwner.t()} | {:error, String.t()}

Returns a resource owner by (username, password) or (id). Returns nil for non matching results.