Ello Go Customer Authentication packages
Common packages for Ello customer authentication.
auth.Authenticator (interface)
The auth.Authenticator
interface must be implemented by the different authenticators. It contains a CanAccept
method
to quickly check if the authenticator can handle a token, and the Authenticate
method to return an authenticated
auth.Customer
and auth.Token
from a token string.
auth.Provider
auth.Provider
can store multiple implementations of auth.Authenticator
and returns the authenticator that should
be used for a given token.
JWT
jwt.Authenticator
jwt.Authenticator
is an implementation of auth.Authenticator
used to parse JWTs. It supports multiple
implementations of jwt.Authority
as a map, with a string identifier as a key.
jwt.Authority (interface)
jwt.Authority
is an interface to be implemented by different JWT Authorities. An authority must be able to provided a
JWK from a valid kid
(Key ID) and an implementation of jwt.CustomerClaims
.
jwt.CustomerClaims (interface)
jwt.CustomerClaims
is an interface for structs that JWT claims can be unmarshalled into and an authenticated
auth.Customer
can be returned as a result.
Auth0
auth0.Authority
auth0.Authority
is an implementation of jwt.Authority
for Auth0. It will load JKWSs from URLs and search through
these for the provided kid
.
auth0.customerClaims
auth0.customerClaims
is an implementation of jwt.CustomerClaims
for the custom claims of the customer within Auth0
JWTs.
Salesforce
salesforce.Authenticator
salesforce.Authenticator
is an implementation of auth.Authenticator
used to parse Salesforce tokens. The token is
expected to be in the format <salesforce-user-id>:<salesforce-acess-token>
, and if the credentials are correct the
authenticated customer will be fetched from Salesforce and returned.
Breaking changes from v1 -> v2
- The
Authenticate
method on the auth.Authenticator
interface now returns (*Customer, *Token, error)
, which
includes the new auth.Token
.
- The
salesforce.New
constructor replaces the queryUrl string parameter with the new salesforce.Credentials
parameter which contains additional credentials required to introspect access tokens.