| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Yesod.Auth.OAuth2.Google
Description
OAuth2 plugin for http://www.google.com
- Authenticates against Google
- Uses Google user id as credentials identifier
If you were previously relying on email as the creds identifier, you can still do that (and more) by overriding it in the creds returned by the plugin with any value read out of the new userResponse key in .credsExtra
For example:
data User = User { userEmail :: Text } instance FromJSON User where -- you know... authenticate creds = do -- 'getUserResponseJSON' provided by "Yesod.Auth.OAuth" module let Right email = userEmail <$> getUserResponseJSON creds updatedCreds = creds { credsIdent = email } -- continue normally with updatedCredsDocumentation
oauth2Google :: YesodAuth m => Text -> Text -> AuthPlugin m Source #
oauth2GoogleWidget :: YesodAuth m => WidgetFor m () -> Text -> Text -> AuthPlugin m Source #
oauth2GoogleScoped :: YesodAuth m => [Text] -> Text -> Text -> AuthPlugin m Source #
oauth2GoogleScopedWidget :: YesodAuth m => WidgetFor m () -> [Text] -> Text -> Text -> AuthPlugin m Source #