handa-gdata-0.4.1: Library and command-line utility for accessing Google services and APIs.

Safe HaskellNone

Network.Google.OAuth2

Contents

Description

Functions for OAuth 2.0 authentication for Google APIs.

Synopsis

Types

data OAuth2Client Source

Constructors

OAuth2Client 

Fields

clientId :: String

The client ID.

clientSecret :: String

The client secret.

type OAuth2Scope = StringSource

An OAuth 2.0 scope.

data OAuth2Tokens Source

OAuth 2.0 tokens.

Constructors

OAuth2Tokens 

Fields

accessToken :: String

The access token.

refreshToken :: String

The refresh token.

expiresIn :: Rational

The number of seconds until the access token expires.

tokenType :: String

The token type.

Functions

googleScopesSource

Arguments

:: [(String, OAuth2Scope)]

List of names and the corresponding scopes.

The OAuth 2.0 scopes for Google APIs, see https://developers.google.com/oauthplayground/.

formUrlSource

Arguments

:: OAuth2Client

The OAuth 2.0 client.

-> [OAuth2Scope]

The OAuth 2.0 scopes to be authorized.

-> String

The URL for authorization.

Form a URL for authorizing an installed application, see https://developers.google.com/accounts/docs/OAuth2InstalledApp#formingtheurl.

exchangeCodeSource

Arguments

:: OAuth2Client

The OAuth 2.0 client.

-> OAuth2Code

The authorization code.

-> IO OAuth2Tokens

The action for obtaining the tokens.

refreshTokensSource

Arguments

:: OAuth2Client

The client.

-> OAuth2Tokens

The tokens.

-> IO OAuth2Tokens

The action to refresh the tokens.

validateTokensSource

Arguments

:: OAuth2Tokens

The tokens.

-> IO Rational

The number of seconds until the access token expires.