google-oauth2-0.1.0: Google OAuth2 token negotiation

Safe HaskellNone
LanguageHaskell2010

Network.Google.OAuth2

Contents

Synopsis

Types

Getting an access token

getAccessToken Source

Arguments

:: OAuth2Client 
-> [OAuth2Scope] 
-> Maybe FilePath

File in which to cache the token

-> IO OAuth2Token

Refreshed token

Get a valid access token with the given scopes

If given, credentials are cached in a file, thus preventing the need for any prompting on subsequent reuse. N.B. this function always refreshes the access token before returning it.

Lower-level steps

newTokens :: OAuth2Client -> [OAuth2Scope] -> IO OAuth2Tokens Source

Prompt the user for a verification code and exchange it for tokens

refreshTokens :: OAuth2Client -> OAuth2Tokens -> IO OAuth2Tokens Source

Use the refresh token to get a new access token

promptForCode :: OAuth2Client -> [OAuth2Scope] -> IO OAuth2Code Source

Prompt the user for a verification code

exchangeCode :: OAuth2Client -> OAuth2Code -> IO OAuth2Tokens Source

Exchange a verification code for tokens