ExOauth2Provider v0.5.0 ExOauth2Provider.AccessGrants View Source
The boundary for the OauthAccessGrants system.
Link to this section Summary
Functions
Creates an access grant.
Gets a single access grant registered with an application.
See ExOauth2Provider.Mixin.Revocable.revoke/2
.
See ExOauth2Provider.Mixin.Revocable.revoke!/2
.
Link to this section Functions
Link to this function
create_grant(resource_owner, application, attrs, config \\ [])
View Source
create_grant(resource_owner, application, attrs, config \\ [])
View Source
create_grant(
Ecto.Schema.t(),
ExOauth2Provider.Applications.Application.t(),
map(),
keyword()
) :: {:ok, ExOauth2Provider.AccessGrants.AccessGrant.t()} | {:error, term()}
create_grant( Ecto.Schema.t(), ExOauth2Provider.Applications.Application.t(), map(), keyword() ) :: {:ok, ExOauth2Provider.AccessGrants.AccessGrant.t()} | {:error, term()}
Creates an access grant.
Examples
iex> create_grant(resource_owner, application, attrs)
{:ok, %OauthAccessGrant{}}
iex> create_grant(resource_owner, application, attrs)
{:error, %Ecto.Changeset{}}
Link to this function
get_active_grant_for(application, token, config \\ [])
View Source
get_active_grant_for(application, token, config \\ [])
View Source
get_active_grant_for(
ExOauth2Provider.Applications.Application.t(),
binary(),
keyword()
) :: ExOauth2Provider.AccessGrants.AccessGrant.t() | nil
get_active_grant_for( ExOauth2Provider.Applications.Application.t(), binary(), keyword() ) :: ExOauth2Provider.AccessGrants.AccessGrant.t() | nil
Gets a single access grant registered with an application.
Examples
iex> get_active_grant_for(application, "jE9dk",)
%OauthAccessGrant{}
iex> get_active_grant_for(application, "jE9dk")
** nil
Link to this function
revoke(data, config \\ []) View Source
See ExOauth2Provider.Mixin.Revocable.revoke/2
.
Link to this function
revoke!(data, config \\ []) View Source
See ExOauth2Provider.Mixin.Revocable.revoke!/2
.