-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Implements Windows Live Web Authentication and Delegated Authentication -- -- Implements functions for initiating and processing Web Authentication -- requests, as well as Delegated Authentication. See -- http://msdn.microsoft.com/en-us/library/bb404787.aspx @package windowslive @version 0.3 module Network.WindowsLive.App -- | Visit -- https://lx.azure.microsoft.com/Cloud/Provisioning/Default.aspx -- to get your application's Application ID and Secret key data App type AppID = String appId :: App -> AppID -- | Create a new App, validating the Application ID and Secret key new :: (MonadError e m) => String -> String -> m App -- | Decode, validate, and parse a String containing x-www-urlencoded |data -- encrypted with this application's secret decode :: (MonadError e m) => App -> String -> m URLEncoded -- | Generate an application verifier to prove to the server that we know -- the secret and application ID verifier :: App -> POSIXTime -> URLEncoded -- | Windows Live Web Authentication. See -- http://msdn.microsoft.com/en-us/library/bb676633.aspx. module Network.WindowsLive.Login -- | Generate a relative authentication start URL getLoginUrl :: App -> Maybe String -> Maybe String -> URI -- | Generate a relative sign out URL getLogoutUrl :: App -> Maybe String -> URI baseUrl :: URI secureUrl :: URI -- | Parse and validate a token from an authentication response. Throws an -- error on failure. processToken :: (MonadError e m) => App -> String -> m User data User User :: String -> POSIXTime -> User userID :: User -> String userTimestamp :: User -> POSIXTime instance Show User -- | Perform Delegated Authentication with Windows Live. See -- http://msdn.microsoft.com/en-us/library/cc287637.aspx for more -- information about Delegated Authentication. module Network.WindowsLive.ConsentToken -- | A type of offer that we are requesting consent for. In the Windows -- Live documentation, an offer is represented as e.g. "Contacts.View". data OfferType OfferType :: String -> String -> OfferType oName :: OfferType -> String oAction :: OfferType -> String -- | A data type containing the fields that are necessary to make a -- delegated authentication consent request data ConsentQuery ConsentQuery :: [OfferType] -> URI -> URI -> Maybe String -> Maybe String -> ConsentQuery -- | Offers we are requesting consent for qOffers :: ConsentQuery -> [OfferType] -- | The URL that the user's browser will be returned to upon consenting qReturn :: ConsentQuery -> URI -- | The URL to your site's privacy policy qPolicy :: ConsentQuery -> URI -- | Any state your application wants to preserve through the -- authentication process qContext :: ConsentQuery -> Maybe String -- | The locale for the request qMarket :: ConsentQuery -> Maybe String -- | Generate a consent query with the minimum information filled in consentQuery :: [OfferType] -> URI -> URI -> ConsentQuery -- | Given a consent query, generate a (relative) URI to initiate -- Delegated Authentication. This URI must be turned into an absolute URI -- by e.g: -- --
-- let relConsentUrl = getConsentUrl app ts consentQuery -- in relConsentUrl `relativeTo` consentUrl --getConsentUrl :: App -> POSIXTime -> ConsentQuery -> URI -- | The base consent URL for consent requests consentUrl :: URI -- | Extract and validate an encrypted consent token. This function does -- not check to see if the token has expired. processConsentToken :: (MonadError e m) => App -> String -> m ConsentToken -- | An offer type along with an expiration time data Offer Offer :: POSIXTime -> OfferType -> Offer offerExp :: Offer -> POSIXTime offerType :: Offer -> OfferType -- | The parsed consent token data ConsentToken ConsentToken :: DelegationToken -> RefreshToken -> String -> [Offer] -> POSIXTime -> String -> ConsentToken delt :: ConsentToken -> DelegationToken reft :: ConsentToken -> RefreshToken skey :: ConsentToken -> String offers :: ConsentToken -> [Offer] expiration :: ConsentToken -> POSIXTime lid :: ConsentToken -> String type DelegationToken = String type RefreshToken = String instance Show ConsentToken instance Show Offer instance URLEncode ConsentQuery instance Show OfferType