yesod-auth-oauth2-0.1.3: OAuth 2.0 authentication plugins

Safe HaskellNone
LanguageHaskell98

Yesod.Auth.OAuth2.Google

Description

OAuth2 plugin for http://www.google.com

  • Authenticates against Google
  • Uses Google user id or email as credentials identifier
  • Returns given_name, family_name, email, and avatar_url as extras

Note: This may eventually replace Yesod.Auth.GoogleEmail2. Currently it provides the same functionality except that GoogleEmail2 returns more profile information.

Synopsis

Documentation

oauth2Google Source

Arguments

:: YesodAuth m 
=> Text

Client ID

-> Text

Client Secret

-> AuthPlugin m 

Auth with Google

Requests openid and email scopes and uses email as the Creds identifier.

oauth2GoogleScoped Source

Arguments

:: YesodAuth m 
=> [Text]

List of scopes to request

-> Text

Client ID

-> Text

Client Secret

-> AuthPlugin m 

Auth with Google

Requests custom scopes and uses email as the Creds identifier.

oauth2GoogleScopedWithCustomId Source

Arguments

:: YesodAuth m 
=> (GoogleUser -> AccessToken -> Creds m)

A function to generate the credentials

-> [Text]

List of scopes to request

-> Text

Client ID

-> Text

Client secret

-> AuthPlugin m 

Auth with Google

Requests custom scopes and uses the given function to create credentials which allows for using any attribute as the identifier.

See emailUid and googleUid.

googleUid :: GoogleUser -> AccessToken -> Creds m Source

Build a Creds using the user's google-uid as the identifier

emailUid :: GoogleUser -> AccessToken -> Creds m Source

Build a Creds using the user's email as the identifier