happstack-authenticate-0.10.15: Happstack Authentication Library

Safe HaskellNone

Happstack.Auth

Synopsis

Documentation

newtype UserId Source

Constructors

UserId 

Fields

unUserId :: Integer
 

Instances

Eq UserId 
Data UserId 
Ord UserId 
Read UserId 
Show UserId 
Typeable UserId 
SafeCopy UserId 
PathInfo UserId 

data AuthState Source

Constructors

AuthState 

Fields

userPasses :: UserPasses
 
nextUserPassId :: UserPassId
 
authMaps :: AuthMaps
 
nextAuthId :: AuthId
 
authTokens :: AuthTokens
 
defaultSessionTimeout :: Int
 

data ProfileState Source

Constructors

ProfileState 

Fields

profiles :: Profiles
 
authUserMap :: Map AuthId UserId

map of what UserId an AuthId is currently defaulting to

nextUserId :: UserId
 

getUserId :: (Alternative m, Happstack m) => AcidState AuthState -> AcidState ProfileState -> m (Maybe UserId)Source

authProfileHandlerSource

Arguments

:: Happstack m 
=> Text

baseURI for this server part

-> Text

unique path prefix

-> AcidState AuthState

handle for 'AcidState AuthState'

-> AcidState ProfileState

handle for 'AcidState ProfileState'

-> (String -> Html -> Html -> m Response)

template function used to render pages

-> Maybe Credentials

optional Facebook Credentials

-> Maybe Text

optional realm to use for OpenId authentication

-> Text

url to redirect to if authentication and profile selection is successful

-> m Response 

this is a simple entry point into happstack-authenticate that provides reasonable default behavior. A majority of the time you will just call this function.

handleAuthSource

Arguments

:: (Happstack m, MonadRoute m, URL m ~ AuthURL) 
=> AcidState AuthState

database handle for AuthState

-> (String -> Html -> Html -> m Response)

page template function

-> Maybe Credentials

config information for facebook connect

-> Maybe Text

authentication realm

-> Text

URL to redirect to after succesful authentication

-> AuthURL

url to route

-> m Response 

Function which takes care of all AuthURL routes.

The caller provides a page template function which will be used to render pages. The provided page template function takes three arguments:

    String -- ^ string to use in the <title> tag
 -> Html   -- ^ extra headers to add to the <head> tag
 -> Html   -- ^ contents to stick in the <body> tag

handleProfileSource

Arguments

:: (Happstack m, Alternative m, MonadRoute m, URL m ~ ProfileURL) 
=> AcidState AuthState

database handle for AuthState

-> AcidState ProfileState

database handle for ProfileState

-> (String -> Html -> Html -> m Response)

page template function

-> Text

URL to redirect to after successfully picking an identity

-> ProfileURL

URL to route

-> m Response 

Function which takes care of all ProfileURL routes.

The caller provides a page template function which will be used to render pages. The provided page template function takes three arguments:

    String -- ^ string to use in the <title> tag
 -> Html   -- ^ extra headers to add to the <head> tag
 -> Html   -- ^ contents to stick in the <body> tag