authable v0.9.1 Authable.Authorization.App
App Authorization Policy module
Link to this section Summary
Functions
Authorizes client for resouce owner with given scopes
Revokes access to resouce owner’s resources
Link to this section Functions
Link to this function
grant(params)
Authorizes client for resouce owner with given scopes
It authorizes app to access resouce owner’s resouces. Simply, user authorizes a client to grant resouces with scopes. If client already authorized for resouce owner then it checks scopes and updates when necessary.
Examples
# For authorization_code grant type
Authable.Authorization.grant(%{
"user" => %Authable.Model.User{...},
"client_id" => "52024ca6-cf1d-4a9d-bfb6-9bc5023ad56e",
"redirect_uri" => "http://localhost:4000/oauth2/callbacks",
"scope" => "read,write"
%})
Link to this function
revoke(map)
Revokes access to resouce owner’s resources.
Delete all tokens and then removes app for given app identifier.
Examples
# For revoking client(uninstall app)
Authable.Policy.AppAuthorization.revoke(%{
"user" => %Authable.Model.User{...},
"id" => "12024ca6-192b-469d-bfb6-9b45023ad13e"
%})