-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | tutorial for hoauth2-providers module -- -- A tutorial that demostrates how to use hoauth2-providers package for -- OAuth2 Authorization Code flow. @package hoauth2-providers-tutorial @version 0.2 module HOAuth2ProvidersTutorial testAuth0App :: IdpApplication 'AuthorizationCode Auth0 testAuth0Idp :: Idp Auth0 testGoogleIdp :: Idp Google testGoogleApp :: IdpApplication 'AuthorizationCode Google -- | You'll need to find out an better way to create state which -- is recommended in -- https://www.rfc-editor.org/rfc/rfc6749#section-10.12 randomStateValue :: Text data DemoUser DemoUser :: Text -> Maybe Text -> DemoUser [$sel:name:DemoUser] :: DemoUser -> Text [$sel:email:DemoUser] :: DemoUser -> Maybe Text -- | The scotty application app :: IO () -- | / endpoint handler indexH :: IORef (Maybe DemoUser) -> ActionM () -- | loginauth0 endpoint handler loginAuth0H :: ActionM () -- | logingoogle endpoint handler loginGoogleH :: ActionM () -- | /logout endpoint handler logoutH :: IORef (Maybe DemoUser) -> ActionM () -- | oauth2callback endpoint handler callbackH :: IORef (Maybe DemoUser) -> ActionM () handleAuth0Callback :: ExchangeToken -> ExceptT Text IO DemoUser handleGoogleCallback :: ExchangeToken -> ExceptT Text IO DemoUser uriToText :: URI -> Text bslToText :: ByteString -> Text paramValue :: Text -> [Param] -> Either Text Text -- | Lift ExceptT to ActionM which is basically the handler Monad in -- Scotty. excepttToActionM :: Show a => ExceptT Text IO a -> ActionM a oauth2ErrorToText :: TokenRequestError -> Text instance GHC.Show.Show HOAuth2ProvidersTutorial.DemoUser instance GHC.Classes.Eq HOAuth2ProvidersTutorial.DemoUser