Backplane.Oauth.Authorization.Scope (backplane_oauth v1.10.77)

Copy Markdown View Source

Check against given params and return the corresponding scopes

Summary

Functions

Authorize the given scope according to the given client.

Functions

authorize(list)

@spec authorize(
  params :: [
    scope: String.t(),
    against: %{
      optional(:client) => Backplane.Oauth.Client.t(),
      optional(:resource_owner) => struct(),
      optional(:token) => Backplane.Oauth.Token.t()
    }
  ]
) :: {:ok, scope :: String.t()} | {:error, Backplane.Oauth.Error.t()}

Authorize the given scope according to the given client.

Examples

iex> authorize(%{scope: "scope", client: %Client{...}})
{:ok, "scope"}