Safe Haskell | None |
---|
This modules provides templates and routing functions which can be used to integrate authentication into your site.
In most cases, you only need to call the handleAuth
and
hanldeProfile
functions. The other functions are exported in case
you wish to create your own alternatives to handleAuth
/
handleProfile
- handleAuth :: (Happstack m, MonadRoute m, URL m ~ AuthURL) => AcidState AuthState -> (String -> Html -> Html -> m Response) -> Maybe Credentials -> Maybe Text -> Text -> AuthURL -> m Response
- handleProfile :: (Happstack m, Alternative m, MonadRoute m, URL m ~ ProfileURL) => AcidState AuthState -> AcidState ProfileState -> (String -> Html -> Html -> m Response) -> Text -> ProfileURL -> m Response
- handleAuthProfile :: forall m. (Happstack m, MonadRoute m, URL m ~ AuthProfileURL) => AcidState AuthState -> AcidState ProfileState -> (String -> Html -> Html -> m Response) -> Maybe Credentials -> Maybe Text -> Text -> AuthProfileURL -> m Response
- handleAuthProfileRouteT :: forall m. Happstack m => AcidState AuthState -> AcidState ProfileState -> (String -> Html -> Html -> m Response) -> Maybe Credentials -> Maybe Text -> Text -> AuthProfileURL -> RouteT AuthProfileURL m Response
- authProfileHandler :: Happstack m => Text -> Text -> AcidState AuthState -> AcidState ProfileState -> (String -> Html -> Html -> m Response) -> Maybe Credentials -> Maybe Text -> Text -> m Response
- addAuthPage :: (MonadRoute m, URL m ~ AuthURL, Happstack m) => Maybe Credentials -> m Html
- authPicker :: (MonadRoute m, URL m ~ ProfileURL, Happstack m) => Set AuthId -> m Html
- createAccountPage :: (Happstack m, MonadRoute m, URL m ~ AuthURL) => AcidState AuthState -> (String -> Html -> Html -> m Response) -> Text -> AuthURL -> m Response
- googlePage :: (Happstack m, MonadRoute m, URL m ~ AuthURL) => AuthURL -> AuthMode -> m Response
- genericOpenIdPage :: (Happstack m, MonadRoute m, URL m ~ AuthURL) => (String -> Html -> Html -> m Response) -> AuthURL -> AuthMode -> m Response
- yahooPage :: (Happstack m, MonadRoute m, URL m ~ AuthURL) => AuthURL -> AuthMode -> m Response
- liveJournalPage :: (Happstack m, MonadRoute m, URL m ~ AuthURL) => (String -> Html -> Html -> m Response) -> AuthURL -> AuthMode -> m Response
- liveJournalForm :: (Functor m, MonadIO m) => AuthForm m Text
- myspacePage :: (Happstack m, MonadRoute m, URL m ~ AuthURL) => (String -> Html -> Html -> m Response) -> AuthURL -> AuthMode -> m Response
- localLoginPage :: (IsString a, Monoid a1, Happstack m, MonadRoute m, ~ * (URL m) AuthURL) => AcidState (EventState UserPassIdAuthIds) -> (a -> a1 -> Html -> m Response) -> AuthURL -> Text -> m Response
- newAccountForm :: (Functor v, MonadIO v) => AcidState AuthState -> AuthForm v (AuthId, UserPassId)
- personalityPicker :: (MonadRoute m, URL m ~ ProfileURL, Happstack m) => Set Profile -> m Html
- providerPage :: (URL m ~ AuthURL, Happstack m, MonadRoute m) => (String -> Html -> Html -> m Response) -> OpenIdProvider -> AuthURL -> AuthMode -> m Response
- loginPage :: (MonadRoute m, URL m ~ AuthURL, Happstack m) => Maybe Credentials -> m Html
- logoutPage :: (MonadRoute m, URL m ~ AuthURL, Alternative m, Happstack m) => AcidState AuthState -> m Html
- changePasswordPage :: (Happstack m, MonadRoute m, URL m ~ AuthURL) => AcidState AuthState -> (String -> Html -> Html -> m Response) -> AuthURL -> m Response
- changePasswordForm :: (Functor v, MonadIO v) => AcidState AuthState -> UserPass -> AuthForm v Text
handlers
:: (Happstack m, MonadRoute m, URL m ~ AuthURL) | |
=> AcidState AuthState | database handle for |
-> (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
:: (Happstack m, Alternative m, MonadRoute m, URL m ~ ProfileURL) | |
=> AcidState AuthState | database handle for |
-> AcidState ProfileState | database handle for |
-> (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
handleAuthProfile :: forall m. (Happstack m, MonadRoute m, URL m ~ AuthProfileURL) => AcidState AuthState -> AcidState ProfileState -> (String -> Html -> Html -> m Response) -> Maybe Credentials -> Maybe Text -> Text -> AuthProfileURL -> m ResponseSource
handleAuthProfileRouteT :: forall m. Happstack m => AcidState AuthState -> AcidState ProfileState -> (String -> Html -> Html -> m Response) -> Maybe Credentials -> Maybe Text -> Text -> AuthProfileURL -> RouteT AuthProfileURL m ResponseSource
:: 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 |
-> Maybe Text | optional realm to use for |
-> 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.
page functions
addAuthPage :: (MonadRoute m, URL m ~ AuthURL, Happstack m) => Maybe Credentials -> m HtmlSource
authPicker :: (MonadRoute m, URL m ~ ProfileURL, Happstack m) => Set AuthId -> m HtmlSource
createAccountPage :: (Happstack m, MonadRoute m, URL m ~ AuthURL) => AcidState AuthState -> (String -> Html -> Html -> m Response) -> Text -> AuthURL -> m ResponseSource
googlePage :: (Happstack m, MonadRoute m, URL m ~ AuthURL) => AuthURL -> AuthMode -> m ResponseSource
genericOpenIdPage :: (Happstack m, MonadRoute m, URL m ~ AuthURL) => (String -> Html -> Html -> m Response) -> AuthURL -> AuthMode -> m ResponseSource
yahooPage :: (Happstack m, MonadRoute m, URL m ~ AuthURL) => AuthURL -> AuthMode -> m ResponseSource
liveJournalPage :: (Happstack m, MonadRoute m, URL m ~ AuthURL) => (String -> Html -> Html -> m Response) -> AuthURL -> AuthMode -> m ResponseSource
liveJournalForm :: (Functor m, MonadIO m) => AuthForm m TextSource
myspacePage :: (Happstack m, MonadRoute m, URL m ~ AuthURL) => (String -> Html -> Html -> m Response) -> AuthURL -> AuthMode -> m ResponseSource
localLoginPage :: (IsString a, Monoid a1, Happstack m, MonadRoute m, ~ * (URL m) AuthURL) => AcidState (EventState UserPassIdAuthIds) -> (a -> a1 -> Html -> m Response) -> AuthURL -> Text -> m ResponseSource
newAccountForm :: (Functor v, MonadIO v) => AcidState AuthState -> AuthForm v (AuthId, UserPassId)Source
personalityPicker :: (MonadRoute m, URL m ~ ProfileURL, Happstack m) => Set Profile -> m HtmlSource
providerPage :: (URL m ~ AuthURL, Happstack m, MonadRoute m) => (String -> Html -> Html -> m Response) -> OpenIdProvider -> AuthURL -> AuthMode -> m ResponseSource
loginPage :: (MonadRoute m, URL m ~ AuthURL, Happstack m) => Maybe Credentials -> m HtmlSource
logoutPage :: (MonadRoute m, URL m ~ AuthURL, Alternative m, Happstack m) => AcidState AuthState -> m HtmlSource