| Portability | non-portable |
|---|---|
| Stability | experimental |
| Maintainer | me@jspha.com |
| Safe Haskell | None |
Network.OAuth.ThreeLegged
Description
The "Three-legged OAuth" protocol implementing RFC 5849's Redirection-Based Authorization.
- data ThreeLegged = ThreeLegged {}
- parseThreeLegged :: String -> String -> String -> Callback -> Either HttpException ThreeLegged
- data Callback
- requestTemporaryToken :: MonadIO m => ThreeLegged -> OAuthT Client m (Maybe (Token Temporary))
- buildAuthorizationUrl :: Monad m => ThreeLegged -> OAuthT Temporary m URI
- requestPermanentToken :: MonadIO m => ThreeLegged -> Verifier -> OAuthT Temporary m (Maybe (Token Permanent))
- requestTemporaryTokenRaw :: MonadIO m => ThreeLegged -> OAuthT Client m ByteString
- requestPermanentTokenRaw :: MonadIO m => ThreeLegged -> Verifier -> OAuthT Temporary m ByteString
- requestTokenProtocol :: MonadIO m => ThreeLegged -> OAuthT Client m (Maybe (Token Permanent))
Configuration types
data ThreeLegged Source
Data parameterizing the "Three-legged OAuth" redirection-based authorization protocol. These parameters cover the protocol as described in the community editions OAuth Core 1.0 and OAuth Core 1.0a as well as RFC 5849.
Constructors
| ThreeLegged | |
Fields
| |
Instances
parseThreeLegged :: String -> String -> String -> Callback -> Either HttpException ThreeLeggedSource
Convenience method for creating a ThreeLegged configuration from
a trio of URLs and a Callback.
When performing the second leg of the three-leg token request workflow,
the user must pass the oauth_verifier code back to the client. In order to
ensure that this protocol is secure, OAuth demands that the client
associates this "callback method" with the temporary credentials generated
for the workflow. This Callback method may be a URL where the parameters
are returned to or the string "oob" which indicates that the user is
responsible for returning the oauth_verifier to the client OutOfBand.
Actions
requestTemporaryToken :: MonadIO m => ThreeLegged -> OAuthT Client m (Maybe (Token Temporary))Source
Returns Nothing if the response could not be decoded as a Token.
Importantly, in RFC 5849 compliant modes this requires that the token
response includes callback_confirmed=true. See also
requestTemporaryTokenRaw.
buildAuthorizationUrl :: Monad m => ThreeLegged -> OAuthT Temporary m URISource
requestPermanentToken :: MonadIO m => ThreeLegged -> Verifier -> OAuthT Temporary m (Maybe (Token Permanent))Source
Returns Nothing if the response could not be decoded as a Token.
See also requestPermanentTokenRaw.
Raw forms
requestTemporaryTokenRaw :: MonadIO m => ThreeLegged -> OAuthT Client m ByteStringSource
Request a Temporary Token based on the parameters of
a ThreeLegged protocol. This returns the raw response which should be
encoded as www-form-urlencoded.
requestPermanentTokenRaw :: MonadIO m => ThreeLegged -> Verifier -> OAuthT Temporary m ByteStringSource
Request a 'Permanent Token based on the parameters of
a ThreeLegged protocol. This returns the raw response which should be
encoded as www-form-urlencoded.
Example system
requestTokenProtocol :: MonadIO m => ThreeLegged -> OAuthT Client m (Maybe (Token Permanent))Source
Performs an interactive token request over stdin assuming that the verifier code is acquired out-of-band.