authable v0.5.1 Authable.Authentications.Token

Base token authentication helper. Differently from Bearer or Session, this module is a generic helper module. It enables to match with any token type from ‘token store(Authable.Token)’.

Summary

Functions

Authenticates resource-owner using given token name and value pairs

Functions

authenticate(token_name, token_value)

Authenticates resource-owner using given token name and value pairs.

It matches resource owner with given token name and value. If any resource owner matched given credentials, it returns resource owner struct, otherwise nil.

Examples

# Suppose we store a confirmation_token at 'token store'
# with token value "ct123456789"
# If we pass the token value to the function,
# it will return resource-owner.
Authable.Authentications.Token.authenticate("confirmation_token",
  "ct123456789")