Documentation ¶
Overview ¶
Package threeleg provides functions for working with the three-legged OAuth flow described at https://developer.lyft.com/v1/docs/authentication#section-3-legged-flow-for-accessing-user-specific-endpoints.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthorizationCode ¶
AuthorizationCode retrieves the authorization code sent in the authorization redirect request from Lyft. If ReadForm hasn't been called on the request already, it will be called during the process.
func AuthorizationURL ¶
AuthorizationURL constructs the URL that a user should be directed to, in order for the user to grant the list of permissions your application is requesting.
Types ¶
type RefreshedToken ¶
type RefreshedToken struct { AccessToken string TokenType string Expires time.Duration Scopes []string }
RefreshedToken is returned by RefreshToken.
func RefreshToken ¶
func RefreshToken(c *http.Client, baseURL, clientID, clientSecret, refreshToken string) (RefreshedToken, http.Header, error)
RefreshToken refreshes the access token associated with refreshToken. See Token for obtaining access/refresh token pairs. baseURL is typically lyft.BaseURL.
type Token ¶
type Token struct { AccessToken string RefreshToken string TokenType string Expires time.Duration Scopes []string }
Token is returned by GenerateToken.
func GenerateToken ¶
func GenerateToken(c *http.Client, baseURL, clientID, clientSecret, code string) (Token, http.Header, error)
GenerateToken creates a new access token using the authorization code obtained from Lyft's authorization redirect. The access token returned can be used in lyft.Client. baseURL is typically lyft.BaseURL.