authable v0.6.6 Authable.Authentication.Bearer

Bearer authencation helper module, implements Authable.Authentication behaviour.

Summary

Functions

Authenticates resource-owner using access_token map

Functions

authenticate(access_token, required_scopes)

Authenticates resource-owner using access_token map.

It reads access_token value from given input and delegates value to Authable.Authentication.Bearer.authenticate/1 function.

Examples

# Suppose we have a access_token at 'token store(Authable.Token)'
# with token value "at123456789"
# If we pass the token value to the function,
# it will return resource-owner.
Authable.Authentication.Bearer.authenticate(
 %{"access_token" => "at123456789"}, ["read"])
# or
Authable.Authentication.Bearer.authenticate("at123456789", ["read"])
# or
Authable.Authentication.Bearer.authenticate("Bearer at123456789",
  ["read"])