View Source Boruta.Oauth.Authorization.Scope (Boruta core v2.1.5)

Check against given params and return the corresponding scopes

Link to this section Summary

Functions

Authorize the given scope according to the given client.

Link to this section Functions

Specs

authorize(
  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(),
        id_token_signature_alg: term(),
        id_token_ttl: term(),
        name: term(),
        pkce: term(),
        private_key: term(),
        public_key: term(),
        public_refresh_token: term(),
        public_revoke: 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(),
        inserted_at: term(),
        nonce: 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.

Examples

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