authable v0.9.1 Authable.Authentication.Bearer

Bearer authentication helper module, implements Authable.Authentication behaviour.

Link to this section Summary

Functions

Authenticates resource-owner using access_token map

Link to this section Functions

Link to this function 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"])