authenticate-oauth-1.7: Library to authenticate with OAuth for Haskell web applications.

Safe Haskell | None
Language | Haskell2010

Web.Authenticate.OAuth

Contents

- Data types
  - Access token request
- Operations for credentials
- Signature
- Url & operation for authentication
  - Temporary credentials
  - Authorization URL
  - Attaching auth to requests
  - Finishing authentication
- Utility Methods

Synopsis

- data OAuth
- def :: Default a => a
- newOAuth :: OAuth
- oauthServerName :: OAuth -> String
- oauthRequestUri :: OAuth -> String
- oauthAccessTokenUri :: OAuth -> String
- oauthAuthorizeUri :: OAuth -> String
- oauthSignatureMethod :: OAuth -> SignMethod
- oauthConsumerKey :: OAuth -> ByteString
- oauthConsumerSecret :: OAuth -> ByteString
- oauthCallback :: OAuth -> Maybe ByteString
- oauthRealm :: OAuth -> Maybe ByteString
- oauthVersion :: OAuth -> OAuthVersion
- data OAuthVersion
  - = OAuth10
  - | OAuth10a
- data SignMethod
  - = PLAINTEXT
  - | HMACSHA1
  - | HMACSHA256
  - | HMACSHA512
  - | RSASHA1 PrivateKey
  - | RSASHA256 PrivateKey
  - | RSASHA512 PrivateKey
- newtype Credential = Credential {
  - unCredential :: [(ByteString, ByteString)]
  }
- newtype OAuthException = OAuthException String
- data AccessTokenRequest
- defaultAccessTokenRequest :: OAuth -> Credential -> Manager -> AccessTokenRequest
- accessTokenAddAuth :: AccessTokenRequest -> ByteString -> Credential -> Request -> Request
- accessTokenRequestHook :: AccessTokenRequest -> Request -> Request
- accessTokenOAuth :: AccessTokenRequest -> OAuth
- accessTokenTemporaryCredential :: AccessTokenRequest -> Credential
- accessTokenManager :: AccessTokenRequest -> Manager
- newCredential :: ByteString -> ByteString -> Credential
- emptyCredential :: Credential
- insert :: ByteString -> ByteString -> Credential -> Credential
- delete :: ByteString -> Credential -> Credential
- inserts :: [(ByteString, ByteString)] -> Credential -> Credential
- injectVerifier :: ByteString -> Credential -> Credential
- signOAuth :: MonadIO m => OAuth -> Credential -> Request -> m Request
- genSign :: MonadIO m => OAuth -> Credential -> Request -> m ByteString
- checkOAuth :: forall (m :: Type -> Type). MonadIO m => OAuth -> Credential -> Request -> ExceptT OAuthException m Request
- getTemporaryCredential :: MonadIO m => OAuth -> Manager -> m Credential
- getTemporaryCredentialWithScope :: MonadIO m => ByteString -> OAuth -> Manager -> m Credential
- getTemporaryCredentialProxy :: MonadIO m => Maybe Proxy -> OAuth -> Manager -> m Credential
- getTemporaryCredential' :: MonadIO m => (Request -> Request) -> OAuth -> Manager -> m Credential
- authorizeUrl :: OAuth -> Credential -> String
- authorizeUrl' :: (OAuth -> Credential -> SimpleQuery) -> OAuth -> Credential -> String
- addAuthBody :: a -> Credential -> Request -> Request
- getAccessToken :: MonadIO m => OAuth -> Credential -> Manager -> m Credential
- getAccessTokenProxy :: MonadIO m => Maybe Proxy -> OAuth -> Credential -> Manager -> m Credential
- getTokenCredential :: MonadIO m => OAuth -> Credential -> Manager -> m Credential
- getTokenCredentialProxy :: MonadIO m => Maybe Proxy -> OAuth -> Credential -> Manager -> m Credential
- getAccessToken' :: MonadIO m => (Request -> Request) -> OAuth -> Credential -> Manager -> m Credential
- getAccessTokenWith :: MonadIO m => AccessTokenRequest -> m (Either (Response ByteString) Credential)
- paramEncode :: ByteString -> ByteString
- addScope :: ByteString -> Request -> Request
- addMaybeProxy :: Maybe Proxy -> Request -> Request

# Data types

data OAuth Source #

Data type for OAuth client (consumer).

The constructor for this data type is not exposed. Instead, you should use the `def` method or `newOAuth` function to retrieve a default instance, and then use the records below to make modifications. This approach allows us to add configuration options without breaking backwards compatibility.

#### Instances

Instances details

Default OAuth Source # |
Instance details Defined in Web.Authenticate.OAuth Methods def :: OAuth Source #
Data OAuth Source # |

Instance details

Defined in Web.Authenticate.OAuth

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OAuth -> c OAuth Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OAuth Source #

toConstr :: OAuth -> Constr Source #

dataTypeOf :: OAuth -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OAuth) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OAuth) Source #

gmapT :: (forall b. Data b => b -> b) -> OAuth -> OAuth Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OAuth -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OAuth -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> OAuth -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> OAuth -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> OAuth -> m OAuth Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OAuth -> m OAuth Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OAuth -> m OAuth Source #

Read OAuth Source # |
Instance details Defined in Web.Authenticate.OAuth Methods readsPrec :: Int -> ReadS OAuth Source # readList :: ReadS [OAuth] Source # readPrec :: ReadPrec OAuth Source # readListPrec :: ReadPrec [OAuth] Source #
Show OAuth Source # |
Instance details Defined in Web.Authenticate.OAuth Methods showsPrec :: Int -> OAuth -> ShowS Source # show :: OAuth -> String Source # showList :: [OAuth] -> ShowS Source #
Eq OAuth Source # |
Instance details Defined in Web.Authenticate.OAuth Methods (==) :: OAuth -> OAuth -> Bool Source # (/=) :: OAuth -> OAuth -> Bool Source #

def :: Default a => a Source #

The default value for this type.

newOAuth :: OAuth Source #

Default value for OAuth datatype. You must specify at least oauthServerName, URIs and Tokens.

oauthServerName :: OAuth -> String Source #

Service name (default: `""`)

oauthRequestUri :: OAuth -> String Source #

URI to request temporary credential (default: `""`). You MUST specify if you use `getTemporaryCredential'`, `getTemporaryCredentialProxy` or `getTemporaryCredential`; otherwise you can just leave this empty.

oauthAccessTokenUri :: OAuth -> String Source #

Uri to obtain access token (default: `""`). You MUST specify if you use `getAcessToken` or `getAccessToken'` or `getAccessTokenWith`; otherwise you can just leave this empty.

oauthAuthorizeUri :: OAuth -> String Source #

Uri to authorize (default: `""`). You MUST specify if you use `authorizeUrl` or `authorizeZUrl'`; otherwise you can just leave this empty.

oauthSignatureMethod :: OAuth -> SignMethod Source #

Signature Method (default: `HMACSHA1`)

oauthConsumerKey :: OAuth -> ByteString Source #

Consumer key (You MUST specify)

oauthConsumerSecret :: OAuth -> ByteString Source #

Consumer Secret (You MUST specify)

oauthCallback :: OAuth -> Maybe ByteString Source #

Callback uri to redirect after authentication (default: `Nothing`)

oauthRealm :: OAuth -> Maybe ByteString Source #

Optional authorization realm (default: `Nothing`)

oauthVersion :: OAuth -> OAuthVersion Source #

OAuth spec version (default: `OAuth10a`)

data OAuthVersion Source #

Constructors

OAuth10 | OAuth protocol ver 1.0 (no oauth_verifier; differs from RFC 5849).
OAuth10a | OAuth protocol ver 1.0a. This corresponds to community's 1.0a spec and RFC 5849.

#### Instances

Instances details

Data OAuthVersion Source # |

Instance details

Defined in Web.Authenticate.OAuth

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OAuthVersion -> c OAuthVersion Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OAuthVersion Source #

toConstr :: OAuthVersion -> Constr Source #

dataTypeOf :: OAuthVersion -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OAuthVersion) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OAuthVersion) Source #

gmapT :: (forall b. Data b => b -> b) -> OAuthVersion -> OAuthVersion Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OAuthVersion -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OAuthVersion -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> OAuthVersion -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> OAuthVersion -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> OAuthVersion -> m OAuthVersion Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OAuthVersion -> m OAuthVersion Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OAuthVersion -> m OAuthVersion Source #

Enum OAuthVersion Source # |

Instance details

Defined in Web.Authenticate.OAuth

Methods

succ :: OAuthVersion -> OAuthVersion Source #

pred :: OAuthVersion -> OAuthVersion Source #

toEnum :: Int -> OAuthVersion Source #

fromEnum :: OAuthVersion -> Int Source #

enumFrom :: OAuthVersion -> [OAuthVersion] Source #

enumFromThen :: OAuthVersion -> OAuthVersion -> [OAuthVersion] Source #

enumFromTo :: OAuthVersion -> OAuthVersion -> [OAuthVersion] Source #

enumFromThenTo :: OAuthVersion -> OAuthVersion -> OAuthVersion -> [OAuthVersion] Source #

Read OAuthVersion Source # |
Instance details Defined in Web.Authenticate.OAuth Methods readsPrec :: Int -> ReadS OAuthVersion Source # readList :: ReadS [OAuthVersion] Source # readPrec :: ReadPrec OAuthVersion Source # readListPrec :: ReadPrec [OAuthVersion] Source #
Show OAuthVersion Source # |
Instance details Defined in Web.Authenticate.OAuth Methods showsPrec :: Int -> OAuthVersion -> ShowS Source # show :: OAuthVersion -> String Source # showList :: [OAuthVersion] -> ShowS Source #
Eq OAuthVersion Source # |
Instance details Defined in Web.Authenticate.OAuth Methods (==) :: OAuthVersion -> OAuthVersion -> Bool Source # (/=) :: OAuthVersion -> OAuthVersion -> Bool Source #
Ord OAuthVersion Source # |

Instance details

Defined in Web.Authenticate.OAuth

Methods

compare :: OAuthVersion -> OAuthVersion -> Ordering Source #

(<) :: OAuthVersion -> OAuthVersion -> Bool Source #

(<=) :: OAuthVersion -> OAuthVersion -> Bool Source #

(>) :: OAuthVersion -> OAuthVersion -> Bool Source #

(>=) :: OAuthVersion -> OAuthVersion -> Bool Source #

max :: OAuthVersion -> OAuthVersion -> OAuthVersion Source #

min :: OAuthVersion -> OAuthVersion -> OAuthVersion Source #

data SignMethod Source #

Data type for signature method.

Constructors

PLAINTEXT |
HMACSHA1 |
HMACSHA256 |
HMACSHA512 |
RSASHA1 PrivateKey |
RSASHA256 PrivateKey |
RSASHA512 PrivateKey |

#### Instances

Instances details

Data SignMethod Source # |

Instance details

Defined in Web.Authenticate.OAuth

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SignMethod -> c SignMethod Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SignMethod Source #

toConstr :: SignMethod -> Constr Source #

dataTypeOf :: SignMethod -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SignMethod) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SignMethod) Source #

gmapT :: (forall b. Data b => b -> b) -> SignMethod -> SignMethod Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SignMethod -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SignMethod -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> SignMethod -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SignMethod -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SignMethod -> m SignMethod Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SignMethod -> m SignMethod Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SignMethod -> m SignMethod Source #

Read SignMethod Source # |
Instance details Defined in Web.Authenticate.OAuth Methods readsPrec :: Int -> ReadS SignMethod Source # readList :: ReadS [SignMethod] Source # readPrec :: ReadPrec SignMethod Source # readListPrec :: ReadPrec [SignMethod] Source #
Show SignMethod Source # |
Instance details Defined in Web.Authenticate.OAuth Methods showsPrec :: Int -> SignMethod -> ShowS Source # show :: SignMethod -> String Source # showList :: [SignMethod] -> ShowS Source #
Eq SignMethod Source # |
Instance details Defined in Web.Authenticate.OAuth Methods (==) :: SignMethod -> SignMethod -> Bool Source # (/=) :: SignMethod -> SignMethod -> Bool Source #

newtype Credential Source #

Data type for credential.

Constructors

Credential |

Fields

- unCredential :: [(ByteString, ByteString)]

#### Instances

Instances details

Data Credential Source # |

Instance details

Defined in Web.Authenticate.OAuth

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Credential -> c Credential Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Credential Source #

toConstr :: Credential -> Constr Source #

dataTypeOf :: Credential -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Credential) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Credential) Source #

gmapT :: (forall b. Data b => b -> b) -> Credential -> Credential Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Credential -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Credential -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Credential -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Credential -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Credential -> m Credential Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Credential -> m Credential Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Credential -> m Credential Source #

Read Credential Source # |
Instance details Defined in Web.Authenticate.OAuth Methods readsPrec :: Int -> ReadS Credential Source # readList :: ReadS [Credential] Source # readPrec :: ReadPrec Credential Source # readListPrec :: ReadPrec [Credential] Source #
Show Credential Source # |
Instance details Defined in Web.Authenticate.OAuth Methods showsPrec :: Int -> Credential -> ShowS Source # show :: Credential -> String Source # showList :: [Credential] -> ShowS Source #
Eq Credential Source # |
Instance details Defined in Web.Authenticate.OAuth Methods (==) :: Credential -> Credential -> Bool Source # (/=) :: Credential -> Credential -> Bool Source #
Ord Credential Source # |

Instance details

Defined in Web.Authenticate.OAuth

Methods

compare :: Credential -> Credential -> Ordering Source #

(<) :: Credential -> Credential -> Bool Source #

(<=) :: Credential -> Credential -> Bool Source #

(>) :: Credential -> Credential -> Bool Source #

(>=) :: Credential -> Credential -> Bool Source #

max :: Credential -> Credential -> Credential Source #

min :: Credential -> Credential -> Credential Source #

newtype OAuthException Source #

Constructors

OAuthException String |

#### Instances

Instances details

Data OAuthException Source # |

Instance details

Defined in Web.Authenticate.OAuth

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OAuthException -> c OAuthException Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OAuthException Source #

toConstr :: OAuthException -> Constr Source #

dataTypeOf :: OAuthException -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OAuthException) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OAuthException) Source #

gmapT :: (forall b. Data b => b -> b) -> OAuthException -> OAuthException Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OAuthException -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OAuthException -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> OAuthException -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> OAuthException -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> OAuthException -> m OAuthException Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OAuthException -> m OAuthException Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OAuthException -> m OAuthException Source #

Exception OAuthException Source # |
Instance details Defined in Web.Authenticate.OAuth Methods toException :: OAuthException -> SomeException Source # fromException :: SomeException -> Maybe OAuthException Source # displayException :: OAuthException -> String Source # backtraceDesired :: OAuthException -> Bool Source #
Show OAuthException Source # |
Instance details Defined in Web.Authenticate.OAuth Methods showsPrec :: Int -> OAuthException -> ShowS Source # show :: OAuthException -> String Source # showList :: [OAuthException] -> ShowS Source #
Eq OAuthException Source # |
Instance details Defined in Web.Authenticate.OAuth Methods (==) :: OAuthException -> OAuthException -> Bool Source # (/=) :: OAuthException -> OAuthException -> Bool Source #

## Access token request

data AccessTokenRequest Source #

Data type for getAccessTokenWith method.

You can create values of this type using `defaultAccessTokenRequest`.

Since 1.5.1

defaultAccessTokenRequest :: OAuth -> Credential -> Manager -> AccessTokenRequest Source #

Create a value of type `AccessTokenRequest` with default values filled in.

Note that this is a settings type. More information on usage can be found at: http://www.yesodweb.com/book/settings-types.

Since 1.5.1

accessTokenAddAuth :: AccessTokenRequest -> ByteString -> Credential -> Request -> Request Source #

add auth hook.

Default: addAuthHeader

Since 1.5.1

accessTokenRequestHook :: AccessTokenRequest -> Request -> Request Source #

Request Hook.

Default: `id`

Since 1.5.1

accessTokenOAuth :: AccessTokenRequest -> OAuth Source #

OAuth Application

Since 1.5.1

accessTokenTemporaryCredential :: AccessTokenRequest -> Credential Source #

Temporary Credential (with oauth_verifier if >= 1.0a)

Since 1.5.1

accessTokenManager :: AccessTokenRequest -> Manager Source #

Manager

Since 1.5.1

# Operations for credentials

newCredential Source #

Arguments

:: ByteString | value for oauth_token
-> ByteString | value for oauth_token_secret
-> Credential |

Convenient function to create `Credential` with OAuth Token and Token Secret.

emptyCredential :: Credential Source #

Empty credential.

insert Source #

Arguments

:: ByteString | Parameter Name
-> ByteString | Value
-> Credential | Credential
-> Credential | Result

Insert an oauth parameter into given `Credential`.

delete Source #

Arguments

:: ByteString | Parameter name
-> Credential | Credential
-> Credential | Result

Remove an oauth parameter for key from given `Credential`.

inserts :: [(ByteString, ByteString)] -> Credential -> Credential Source #

Convenient method for inserting multiple parameters into credential.

injectVerifier :: ByteString -> Credential -> Credential Source #

Insert `oauth-verifier` on a `Credential`.

# Signature

signOAuth Source #

Arguments

:: MonadIO m |
=> OAuth | OAuth Application
-> Credential | Credential
-> Request | Original Request
-> m Request | Signed OAuth Request

Add OAuth headers & sign to `Request`.

genSign :: MonadIO m => OAuth -> Credential -> Request -> m ByteString Source #

Generate OAuth signature. Used by `signOAuth`.

checkOAuth :: forall (m :: Type -> Type). MonadIO m => OAuth -> Credential -> Request -> ExceptT OAuthException m Request Source #

Test existing OAuth signature. Since 1.5.2

# Url & operation for authentication

## Temporary credentials

getTemporaryCredential Source #

Arguments

:: MonadIO m |
=> OAuth | OAuth Application
-> Manager |
-> m Credential | Temporary Credential (Request Token & Secret).

Get temporary credential for requesting acces token.

getTemporaryCredentialWithScope Source #

Arguments

:: MonadIO m |
=> ByteString | Scope parameter string
-> OAuth | OAuth Application
-> Manager |
-> m Credential | Temporay Credential (Request Token & Secret).

Get temporary credential for requesting access token with Scope parameter.

getTemporaryCredentialProxy Source #

Arguments

:: MonadIO m |
=> Maybe Proxy | Proxy
-> OAuth | OAuth Application
-> Manager |
-> m Credential | Temporary Credential (Request Token & Secret).

Get temporary credential for requesting access token via the proxy.

getTemporaryCredential' Source #

Arguments

:: MonadIO m |
=> (Request -> Request) | Request Hook
-> OAuth | OAuth Application
-> Manager |
-> m Credential | Temporary Credential (Request Token & Secret).

## Authorization URL

authorizeUrl Source #

Arguments

:: OAuth | OAuth Application
-> Credential | Temporary Credential (Request Token & Secret)
-> String | URL to authorize

URL to obtain OAuth verifier.

authorizeUrl' Source #

Arguments

:: (OAuth -> Credential -> SimpleQuery) |
-> OAuth | OAuth Application
-> Credential | Temporary Credential (Request Token & Secret)
-> String | URL to authorize

Convert OAuth and Credential to URL to authorize. This takes function to choice parameter to pass to the server other than oauth_callback or oauth_token.

## Attaching auth to requests

addAuthBody :: a -> Credential -> Request -> Request Source #

Place the authentication information in a URL encoded body instead of the Authorization header.

Note that the first parameter is used for realm in addAuthHeader, and this function needs the same type. The parameter, however, is unused.

Since 1.5.1

## Finishing authentication

getAccessToken Source #

Arguments

:: MonadIO m |
=> OAuth | OAuth Application
-> Credential | Temporary Credential (with oauth_verifier if >= 1.0a)
-> Manager |
-> m Credential | Token Credential (Access Token & Secret)

Get Access token.

getAccessTokenProxy Source #

Arguments

:: MonadIO m |
=> Maybe Proxy | Proxy
-> OAuth | OAuth Application
-> Credential | Temporary Credential (with oauth_verifier if >= 1.0a)
-> Manager |
-> m Credential | Token Credential (Access Token & Secret)

Get Access token via the proxy.

getTokenCredential Source #

Arguments

:: MonadIO m |
=> OAuth | OAuth Application
-> Credential | Temporary Credential (with oauth_verifier if >= 1.0a)
-> Manager |
-> m Credential | Token Credential (Access Token & Secret)

Get Access token.

getTokenCredentialProxy Source #

Arguments

:: MonadIO m |
=> Maybe Proxy | Proxy
-> OAuth | OAuth Application
-> Credential | Temporary Credential (with oauth_verifier if >= 1.0a)
-> Manager |
-> m Credential | Token Credential (Access Token & Secret)

Get Access token via the proxy.

getAccessToken' Source #

Arguments

:: MonadIO m |
=> (Request -> Request) | Request Hook
-> OAuth | OAuth Application
-> Credential | Temporary Credential (with oauth_verifier if >= 1.0a)
-> Manager |
-> m Credential | Token Credential (Access Token & Secret)

getAccessTokenWith Source #

Arguments

:: MonadIO m |
=> AccessTokenRequest | extensible parameters
-> m (Either (Response ByteString) Credential) | Token Credential (Access Token & Secret) or the conduit response on failures

# Utility Methods

paramEncode :: ByteString -> ByteString Source #

Encode a string using the percent encoding method for OAuth.

addScope :: ByteString -> Request -> Request Source #

addMaybeProxy :: Maybe Proxy -> Request -> Request Source #