Packages
boruta
2.3.3
3.0.0-beta.4
3.0.0-beta.3
3.0.0-beta.2
3.0.0-beta.1
2.3.6
2.3.5
2.3.4
2.3.3
2.3.2
2.3.1
2.3.0
2.2.2
2.2.1
2.2.0
2.1.5
2.1.4
2.1.3
2.1.2
2.1.1
2.1.0
2.0.1
2.0.0
2.0.0-rc.1
2.0.0-rc.0
1.2.1
1.2.0
1.1.0
1.0.3
1.0.2
1.0.1
1.0.0
1.0.0-rc.3
1.0.0-rc.2
1.0.0-rc.1
1.0.0-rc.0
0.2.1
0.2.0
0.1.1
0.1.0
0.1.0-rc.5
0.1.0-rc.4
0.1.0-rc.3
0.1.0-rc.2
0.1.0-rc.1
Core of an OAuth/OpenID Connect provider enabling authorization in your applications.
Current section
Files
Jump to
Current section
Files
lib/boruta/oauth/contexts/resource_owners.ex
defmodule Boruta.Oauth.ResourceOwners do
@moduledoc """
Resource owner context
"""
alias Boruta.Oauth.ResourceOwner
@doc """
Returns a resource owner by (username) or (id).
"""
@callback get_by([username: String.t()] | [sub: String.t()]) ::
{:ok, resource_owner :: ResourceOwner.t()} | {:error, String.t()}
@doc """
Determines if given password is valid for the given resource owner.
"""
@callback check_password(resource_owner :: ResourceOwner.t(), password :: String.t()) ::
:ok | {:error, String.t()}
@doc """
Returns a list of authorized scopes for a given resource owner. These scopes will be granted is requested for the user.
"""
@callback authorized_scopes(resource_owner :: ResourceOwner.t()) :: list(Boruta.Oauth.Scope.t())
@doc """
Returns `id_token` identity claims for the given resource owner. Those claims will be present in resulting `id_token` of OpenID Connect flows.
"""
@callback claims(resource_owner :: ResourceOwner.t(), scope :: String.t()) :: claims :: Boruta.Oauth.IdToken.claims()
@optional_callbacks claims: 2
end