Boruta.Oauth.Authorization.Scope (Boruta core v1.2.0) View Source

Scope authorization

Link to this section Summary


Authorize the given scope according to the given client.

Link to this section Functions


  params :: [
    scope: String.t(),
    against: %{
      optional(:client) => %Boruta.Oauth.Client{
        access_token_ttl: term(),
        authorization_code_ttl: term(),
        authorize_scope: term(),
        authorized_scopes: term(),
        id: term(),
        name: term(),
        pkce: term(),
        private_key: term(),
        public_key: term(),
        public_refresh_token: term(),
        redirect_uris: term(),
        refresh_token_ttl: term(),
        secret: term(),
        supported_grant_types: term()
      optional(:resource_owner) => struct(),
      optional(:token) => %Boruta.Oauth.Token{
        client: term(),
        code_challenge: term(),
        code_challenge_hash: term(),
        code_challenge_method: term(),
        expires_at: term(),
        id: term(),
        inserted_at: term(),
        redirect_uri: term(),
        refresh_token: term(),
        resource_owner: term(),
        revoked_at: term(),
        scope: term(),
        state: term(),
        sub: term(),
        type: term(),
        value: term()
) :: {:ok, scope :: String.t()} | {:error, Boruta.Oauth.Error.t()}

Authorize the given scope according to the given client.


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