yesod-auth-1.6.10: Authentication for Yesod.

Safe HaskellNone
LanguageHaskell98

Yesod.Auth.GoogleEmail2

Contents

Description

Deprecated: Google+ is being shut down, please migrate to Google Sign-in https://pbrisbin.com/posts/googleemail2_deprecation/

Use an email address as an identifier via Google's login system.

Note that this is a replacement for Yesod.Auth.GoogleEmail, which depends on Google's now deprecated OpenID system. For more information, see https://developers.google.com/+/api/auth-migration.

By using this plugin, you are trusting Google to validate an email address, and requiring users to have a Google account. On the plus side, you get to use email addresses as the identifier, many users have existing Google accounts, the login system has been long tested (as opposed to BrowserID), and it requires no credential managing or setup (as opposed to Email).

In order to use this plugin:

Since: 1.3.1

Synopsis

Authentication handlers

authGoogleEmail Source #

Arguments

:: YesodAuth m 
=> Text

client ID

-> Text

client secret

-> AuthPlugin m 

authGoogleEmailSaveToken Source #

Arguments

:: YesodAuth m 
=> Text

client ID

-> Text

client secret

-> AuthPlugin m 

An alternative version which stores user access token in the session variable. Use it if you want to request user's profile from your app.

Since: 1.4.3

User authentication token

data Token Source #

An authentication token which was acquired from OAuth callback. The token gets saved into the session storage only if you use authGoogleEmailSaveToken. You can acquire saved token with getUserAccessToken.

Since: 1.4.3

Constructors

Token 
Instances
Eq Token Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

Methods

(==) :: Token -> Token -> Bool #

(/=) :: Token -> Token -> Bool #

Show Token Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

Methods

showsPrec :: Int -> Token -> ShowS #

show :: Token -> String #

showList :: [Token] -> ShowS #

FromJSON Token Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

getUserAccessToken :: MonadHandler m => m (Maybe Token) Source #

Get user's access token from the session. Returns Nothing if it's not found (probably because the user is not logged in via GoogleEmail2 or you are not using authGoogleEmailSaveToken)

Person

getPerson :: MonadHandler m => Manager -> Token -> m (Maybe Person) Source #

Allows to fetch information about a user from Google's API. In case of parsing error returns Nothing. Will throw HttpException in case of network problems or error response code.

Since: 1.4.3

data Person Source #

Information about the user Full description of the resource https://developers.google.com/+/api/latest/people

Since: 1.4.3

Constructors

Person 

Fields

Instances
Eq Person Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

Methods

(==) :: Person -> Person -> Bool #

(/=) :: Person -> Person -> Bool #

Show Person Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

FromJSON Person Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

data Name Source #

Individual components of a name

Since: 1.4.3

Constructors

Name 

Fields

Instances
Eq Name Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

Methods

(==) :: Name -> Name -> Bool #

(/=) :: Name -> Name -> Bool #

Show Name Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

Methods

showsPrec :: Int -> Name -> ShowS #

show :: Name -> String #

showList :: [Name] -> ShowS #

FromJSON Name Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

data Gender Source #

Gender of the person

Since: 1.4.3

Constructors

Male 
Female 
OtherGender 
Instances
Eq Gender Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

Methods

(==) :: Gender -> Gender -> Bool #

(/=) :: Gender -> Gender -> Bool #

Show Gender Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

FromJSON Gender Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

newtype PersonImage Source #

The URI of the person's profile photo.

Since: 1.4.3

Constructors

PersonImage 

Fields

resizePersonImage :: PersonImage -> Int -> PersonImage Source #

resizePersonImage img 30 would set query part to ?sz=30 which would resize the image under the URI. If for some reason you need to modify the query part, you should do it after resizing.

Since: 1.4.3

data RelationshipStatus Source #

The person's relationship status.

Since: 1.4.3

Constructors

Single

Person is single

InRelationship

Person is in a relationship

Engaged

Person is engaged

Married

Person is married

Complicated

The relationship is complicated

OpenRelationship

Person is in an open relationship

Widowed

Person is widowed

DomesticPartnership

Person is in a domestic partnership

CivilUnion

Person is in a civil union

RelationshipStatus Text

Something else

data PersonURI Source #

URIs specified in the person's profile

Since: 1.4.3

Instances
Eq PersonURI Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

Show PersonURI Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

FromJSON PersonURI Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

data PersonURIType Source #

The type of URI

Since: 1.4.3

Constructors

OtherProfile

URI for another profile

Contributor

URI to a site for which this person is a contributor

Website

URI for this Google+ Page's primary website

OtherURI

Other URL

PersonURIType Text

Something else

data Organization Source #

Current or past organizations with which this person is associated

Since: 1.4.3

Constructors

Organization 

Fields

data Place Source #

A place where the person has lived or is living at the moment.

Since: 1.4.3

Constructors

Place 

Fields

Instances
Eq Place Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

Methods

(==) :: Place -> Place -> Bool #

(/=) :: Place -> Place -> Bool #

Show Place Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

Methods

showsPrec :: Int -> Place -> ShowS #

show :: Place -> String #

showList :: [Place] -> ShowS #

FromJSON Place Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

data Email Source #

Person's email

Since: 1.4.3

Constructors

Email 
Instances
Eq Email Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

Methods

(==) :: Email -> Email -> Bool #

(/=) :: Email -> Email -> Bool #

Show Email Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

Methods

showsPrec :: Int -> Email -> ShowS #

show :: Email -> String #

showList :: [Email] -> ShowS #

FromJSON Email Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

data EmailType Source #

Type of email

Since: 1.4.3

Constructors

EmailAccount

Google account email address

EmailHome

Home email address

EmailWork

Work email adress

EmailOther

Other email address

EmailType Text

Something else

Instances
Eq EmailType Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

Show EmailType Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

FromJSON EmailType Source # 
Instance details

Defined in Yesod.Auth.GoogleEmail2

Other functions

pid :: Text Source #

Plugin identifier. This is used to identify the plugin used for authentication. The credsPlugin will contain this value when this plugin is used for authentication. @since 1.4.17