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

Safe HaskellNone
LanguageHaskell98

Yesod.Auth.OAuth2

Description

Generic OAuth2 plugin for Yesod

  • See Yesod.Auth.OAuth2.GitHub for example usage.

Synopsis

Documentation

authOAuth2 Source

Arguments

:: YesodAuth m 
=> Text

Service name

-> OAuth2

Service details

-> (Manager -> AccessToken -> IO (Creds m))

This function defines how to take an AccessToken and retrieve additional information about the user, to be set in the session as Creds. Usually this means a second authorized request to api/me.json.

See fromProfileURL for an example.

-> AuthPlugin m 

fromProfileURL Source

Arguments

:: FromJSON a 
=> Text

Plugin name

-> URI

Profile URI

-> (a -> Creds m)

Conversion to Creds

-> Manager 
-> AccessToken 
-> IO (Creds m) 

Handle the common case of fetching Profile information a JSON endpoint

Throws InvalidProfileResponse if JSON parsing fails