yesod-auth-fb-1.8.0: Authentication backend for Yesod using Facebook.

Safe HaskellNone
LanguageHaskell98

Yesod.Auth.Facebook.ServerSide

Contents

Description

yesod-auth authentication plugin using Facebook's server-side authentication flow.

Synopsis

Authentication plugin

authFacebook Source #

Arguments

:: (YesodAuth site, YesodFacebook site) 
=> [Permission]

Permissions to be requested.

-> AuthPlugin site 

Yesod authentication plugin using Facebook.

facebookLogin :: AuthRoute Source #

Route for login using this authentication plugin.

facebookLogout :: AuthRoute Source #

Route for logout using this authentication plugin. This will log your user out of your site and log him out of Facebook since, at the time of writing, Facebook's policies (https://developers.facebook.com/policy/) specified that the user needs to be logged out from Facebook itself as well. If you want to always logout from just your site (and not from Facebook), use LogoutR.

Useful functions

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

Get the Facebook's user access token from the session. Returns Nothing if it's not found (probably because the user is not logged in via yesod-auth-fb). Note that the returned access token may have expired, we recommend using hasExpired and isValid.

setUserAccessToken :: MonadHandler m => UserAccessToken -> m () Source #

Set the Facebook's user access token on the user's session. Usually you don't need to call this function, but it may become handy together with extendUserAccessToken.

Advanced

deleteUserAccessToken :: MonadHandler m => m () Source #

Delete Facebook's user access token from the session. Do not use this function unless you know what you're doing.