saml2-web-sso-0.20: Library and example web app for the SAML Web-based SSO profile.
Safe HaskellSafe-Inferred
LanguageHaskell2010

SAML2.WebSSO.API.Example

Description

This is a sample application composed of the end-points in SAML.WebSSO.API plus a minimum of functionality to make a running web application. Some parts of this module could be handy to build other apps, but it is more likely to serve as a tutorial.

Synopsis

Documentation

newtype SimpleSP a Source #

Instances

Instances details
MonadIO SimpleSP Source # 
Instance details

Defined in SAML2.WebSSO.API.Example

Methods

liftIO :: IO a -> SimpleSP a #

Applicative SimpleSP Source # 
Instance details

Defined in SAML2.WebSSO.API.Example

Methods

pure :: a -> SimpleSP a #

(<*>) :: SimpleSP (a -> b) -> SimpleSP a -> SimpleSP b #

liftA2 :: (a -> b -> c) -> SimpleSP a -> SimpleSP b -> SimpleSP c #

(*>) :: SimpleSP a -> SimpleSP b -> SimpleSP b #

(<*) :: SimpleSP a -> SimpleSP b -> SimpleSP a #

Functor SimpleSP Source # 
Instance details

Defined in SAML2.WebSSO.API.Example

Methods

fmap :: (a -> b) -> SimpleSP a -> SimpleSP b #

(<$) :: a -> SimpleSP b -> SimpleSP a #

Monad SimpleSP Source # 
Instance details

Defined in SAML2.WebSSO.API.Example

Methods

(>>=) :: SimpleSP a -> (a -> SimpleSP b) -> SimpleSP b #

(>>) :: SimpleSP a -> SimpleSP b -> SimpleSP b #

return :: a -> SimpleSP a #

HasConfig SimpleSP Source # 
Instance details

Defined in SAML2.WebSSO.API.Example

HasCreateUUID SimpleSP Source # 
Instance details

Defined in SAML2.WebSSO.API.Example

HasLogger SimpleSP Source # 
Instance details

Defined in SAML2.WebSSO.API.Example

Methods

logger :: Level -> String -> SimpleSP () Source #

HasNow SimpleSP Source # 
Instance details

Defined in SAML2.WebSSO.API.Example

MonadError SimpleError SimpleSP Source # 
Instance details

Defined in SAML2.WebSSO.API.Example

MonadReader SimpleSPCtx SimpleSP Source # 
Instance details

Defined in SAML2.WebSSO.API.Example

GetAllIdPs SimpleError SimpleSP Source # 
Instance details

Defined in SAML2.WebSSO.API.Example

SPHandler SimpleError SimpleSP Source #

If you read the Config initially in IO and then pass it into the monad via Reader, you safe disk load and redundant debug logs.

Instance details

Defined in SAML2.WebSSO.API.Example

Associated Types

type NTCTX SimpleSP Source #

Methods

nt :: NTCTX SimpleSP -> SimpleSP x -> Handler x Source #

SPStoreIdP SimpleError SimpleSP Source # 
Instance details

Defined in SAML2.WebSSO.API.Example

SPStoreID Assertion SimpleSP Source # 
Instance details

Defined in SAML2.WebSSO.API.Example

SPStoreID AuthnRequest SimpleSP Source # 
Instance details

Defined in SAML2.WebSSO.API.Example

type IdPConfigExtra SimpleSP Source # 
Instance details

Defined in SAML2.WebSSO.API.Example

type IdPConfigSPId SimpleSP Source # 
Instance details

Defined in SAML2.WebSSO.API.Example

type NTCTX SimpleSP Source # 
Instance details

Defined in SAML2.WebSSO.API.Example

simpleStoreID :: (MonadIO m, MonadReader ctx m) => Lens' ctx (MVar (Map (ID a) Time)) -> ID a -> Time -> m () Source #

simpleStoreID' :: ID a -> Time -> Map (ID a) Time -> Map (ID a) Time Source #

simpleUnStoreID :: (MonadIO m, MonadReader ctx m) => Lens' ctx (MVar (Map (ID a) Time)) -> ID a -> m () Source #

simpleIsAliveID :: (MonadIO m, MonadReader ctx m, SP m) => Lens' ctx (MVar (Map (ID a) Time)) -> ID a -> m Bool Source #

simpleGetIdPConfigBy :: (MonadError (Error err) m, HasConfig m, Show a, Ord a) => m [IdPConfig_] -> (IdPConfig_ -> a) -> a -> m IdPConfig_ Source #

app :: Config -> [IdPConfig_] -> IO Application Source #

The most straight-forward Application that can be constructed from api, API.

app' :: forall (m :: Type -> Type). (SP m, MonadApp m) => Proxy m -> NTCTX m -> IO Application Source #

type SPAPI = (Header "Cookie" Cky :> Get '[HTML] LoginStatus) :<|> (("logout" :> ("local" :> GetRedir '[HTML] (WithCookieAndLocation ST))) :<|> ("logout" :> ("single" :> GetRedir '[HTML] (WithCookieAndLocation ST)))) Source #

type APPAPI = ("sp" :> SPAPI) :<|> ("sso" :> API) Source #

mkLoginOption :: (Monad m, SP m) => IdPConfig a -> m (ST, ST) Source #

localLogout :: SPHandler SimpleError m => m (WithCookieAndLocation ST) Source #

only logout on this SP.

data LoginStatus Source #

Constructors

NotLoggedIn [(ST, ST)] 
LoggedInAs ST ST 

Instances

Instances details
Show LoginStatus Source # 
Instance details

Defined in SAML2.WebSSO.API.Example

Eq LoginStatus Source # 
Instance details

Defined in SAML2.WebSSO.API.Example

MimeRender HTML LoginStatus Source # 
Instance details

Defined in SAML2.WebSSO.API.Example

data Path Source #

Instances

Instances details
Show Path Source # 
Instance details

Defined in SAML2.WebSSO.API.Example

Methods

showsPrec :: Int -> Path -> ShowS #

show :: Path -> String #

showList :: [Path] -> ShowS #

Eq Path Source # 
Instance details

Defined in SAML2.WebSSO.API.Example

Methods

(==) :: Path -> Path -> Bool #

(/=) :: Path -> Path -> Bool #

getPath' :: forall m. (Monad m, HasConfig m) => Path -> m ST Source #

getPath :: forall m. (Monad m, HasConfig m) => Path -> m URI Source #