Documentation ¶
Index ¶
- Variables
- type Strategies
- type Strategy
- func Flickr(baseURL string, store strategyStore, id, secret string, ...) Strategy
- func GitHub(store strategyStore, id, secret string) Strategy
- func PGP(store strategyStore, baseURI, id string, httpClient *http.Client) Strategy
- func True(baseURL string) Strategy
- func Twitter(baseURL string, store strategyStore, id, secret string, ...) Strategy
Constants ¶
This section is empty.
Variables ¶
View Source
var ( errors.New("you are not the user you told me you were") // ErrUnknown is returned when a user seems to have appeared in the middle of // an auth flow. ErrUnknown = errors.New("how did you get here?") )ErrUnauthorized =
Functions ¶
This section is empty.
Types ¶
type Strategy ¶
type Strategy interface { // Name returns a unique lowercase alpha string naming the Strategy. This will // be passed around as the "provider" parameter. Name() string // Match determines from the found profile whether this Strategy can be used. Match(profile *url.URL) bool // Redirect returns the URL to redirect the user to begin the authentication flow. Redirect(me, profile string) (redirectURL string, err error) // Callback handles the user's return from the 3rd party auth provider. It // returns the profile URL for the authenticated user, hopefully matching the // rel="me" link earlier. If it does not match then the user who authenticated // with the OAuth provider is different to the user attempting to authenticate // with relme-auth. Callback(form url.Values) (string, error) }
Strategy is something that can provide authentication for a user.
func Flickr ¶
func Flickr(baseURL string, store strategyStore, id, secret string, httpClient *http.Client) Strategy
Flickr provides a strategy for authenticating with https://www.flickr.com.
func GitHub ¶
GitHub provides a strategy for authenticating with https://github.com.
Click to show internal directories.
Click to hide internal directories.