Package oauth1 provides handles for OAuth1 login and callback requests.
AccessTokenFromContext returns the access token and secret from the ctx.
AuthRedirectHandler reads the request token from the ctx and redirects to the authorization URL.
CallbackHandler handles OAuth1 callback requests by parsing the oauth token and verifier, reading the request token secret from the ctx, then obtaining an access token and adding it to the ctx.
CookieTempHandler persists or retrieves the request token secret (temporary credentials). If the request token can be read from the ctx (login phase), the secret is set in a short-lived cookie to be read later. Otherwise (callback phase) the cookie is read to retrieve the request token secret and add it to the ctx. If the ctx contains no request token and the request has no temp cookie, the failure handler is called.
Some OAuth1 providers (Twitter, Digits) do NOT require temp secrets to be kept between the login phase and callback phase. To implement those providers, use the EmptyTempHandler instead.
EmptyTempHandler adds an empty request token secret to the ctx if none is present to support OAuth1 providers which do not require temp secrets to be kept between the login phase and callback phase.
LoginHandler handles OAuth1 login requests by obtaining a request token and secret (temporary credentials) and adding it to the ctx. If successful, handling delegates to the success handler, otherwise to the failure handler.
Typically, the success handler is an AuthRedirectHandler or a handler which stores the request token secret.
RequestTokenFromContext returns the request token and secret from the ctx.
WithAccessToken returns a copy of ctx that stores the access token and secret values.
WithRequestToken returns a copy of ctx that stores the request token and secret values.