# `Backplane.Oauth.ResourceOwners`
[🔗](https://github.com/gsmlg-opt/backplane/blob/v1.10.77/apps/backplane_oauth/lib/backplane/oauth/contexts/resource_owners.ex#L1)

Resource owner context

# `authorized_scopes`

```elixir
@callback authorized_scopes(resource_owner :: Backplane.Oauth.ResourceOwner.t()) :: [
  Backplane.Oauth.Scope.t()
]
```

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

# `check_password`

```elixir
@callback check_password(
  resource_owner :: Backplane.Oauth.ResourceOwner.t(),
  password :: String.t()
) ::
  :ok | {:error, String.t()}
```

Determines if given password is valid for the given resource owner.

# `claims`
*optional* 

```elixir
@callback claims(resource_owner :: Backplane.Oauth.ResourceOwner.t(), scope :: String.t()) ::
  claims :: Backplane.Oauth.IdToken.claims()
```

Returns `id_token` identity claims for the given resource owner. Those claims will be present in resulting `id_token` of OpenID Connect flows.

# `get_by`

```elixir
@callback get_by([{:username, String.t()}] | [{:sub, String.t()}]) ::
  {:ok, resource_owner :: Backplane.Oauth.ResourceOwner.t()}
  | {:error, String.t()}
```

Returns a resource owner by (username) or (id).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
