-- 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.8.0 module HOAuth2ProvidersTutorial mkTestAuth0App :: ExceptT Text IO (IdpApplication Auth0 AuthorizationCodeApplication) mkTestAuth0Idp :: ExceptT Text IO (Idp Auth0) mkTestGoogleApp :: IdpApplication Google AuthorizationCodeApplication -- | 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 [name] :: DemoUser -> Text [email] :: DemoUser -> Maybe Text -- | The scotty application app :: IO () -- | / endpoint handler indexH :: IORef (Maybe DemoUser) -> ActionM () -- | loginauth0 endpoint handler loginAuth0H :: IdpApplication Auth0 AuthorizationCodeApplication -> ActionM () -- | logingoogle endpoint handler loginGoogleH :: IdpApplication Google AuthorizationCodeApplication -> ActionM () -- | /logout endpoint handler logoutH :: IORef (Maybe DemoUser) -> ActionM () -- | oauth2callback endpoint handler callbackH :: IdpApplication Auth0 AuthorizationCodeApplication -> IdpApplication Google AuthorizationCodeApplication -> IORef (Maybe DemoUser) -> ActionM () handleAuth0Callback :: IdpApplication Auth0 AuthorizationCodeApplication -> ExchangeToken -> ExceptT Text IO DemoUser handleGoogleCallback :: IdpApplication Google AuthorizationCodeApplication -> ExchangeToken -> ExceptT Text IO DemoUser 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 :: TokenResponseError -> Text instance GHC.Show.Show HOAuth2ProvidersTutorial.DemoUser instance GHC.Classes.Eq HOAuth2ProvidersTutorial.DemoUser