gandalf v0.2.0 Gandalf.Authentication.Bearer

Bearer authentication helper module, implements Gandalf.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 Gandalf.Authentication.Bearer.authenticate/1 function.

Examples

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