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

Safe HaskellNone




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


Authentication plugin



:: YesodAuth master 
=> Credentials

Your application's credentials.

-> [Permission]

Permissions to be requested.

-> AuthPlugin master 

Yesod authentication plugin using Facebook.

facebookLogin :: AuthRouteSource

Route for login using this authentication plugin.

facebookLogout :: AuthRouteSource

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 ( 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 :: GHandler sub master (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 :: UserAccessToken -> GHandler sub master ()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.


beta_authFacebook :: YesodAuth master => Credentials -> [Permission] -> AuthPlugin masterSource

Same as authFacebook, but uses Facebook's beta tier. Usually this is not what you want, so use authFacebook unless you know what you're doing.

Since: 0.10.1

deleteUserAccessToken :: GHandler sub master ()Source

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