windowslive-0.1.1.1: Implements Windows Live Web Authentication and Delegated AuthenticationSource codeContentsIndex
Network.WindowsLive.ConsentToken
Contents
Building a Delegated Authentication consent request
Processing a Delegated Authentication consent response
Description
Perform Delegated Authentication with Windows Live. See http://msdn.microsoft.com/en-us/library/cc287637.aspx for more information about Delegated Authentication.
Synopsis
data OfferType = OfferType {
oName :: String
oAction :: String
}
data ConsentQuery = ConsentQuery {
qOffers :: [OfferType]
qReturn :: URI
qPolicy :: URI
qContext :: Maybe String
qMarket :: Maybe String
}
consentQuery :: [OfferType] -> URI -> URI -> ConsentQuery
getConsentUrl :: App -> POSIXTime -> ConsentQuery -> URI
consentUrl :: URI
processConsentToken :: MonadError e m => App -> String -> m ConsentToken
data Offer = Offer {
offerExp :: POSIXTime
offerType :: OfferType
}
data ConsentToken = ConsentToken {
delt :: DelegationToken
reft :: RefreshToken
skey :: String
offers :: [Offer]
expiration :: POSIXTime
lid :: String
}
type DelegationToken = String
type RefreshToken = String
Building a Delegated Authentication consent request
data OfferType Source
A type of offer that we are requesting consent for. In the Windows Live documentation, an offer is represented as e.g. "Contacts.View".
Constructors
OfferType
oName :: String
oAction :: String
show/hide Instances
data ConsentQuery Source
A data type containing the fields that are necessary to make a delegated authentication consent request
Constructors
ConsentQuery
qOffers :: [OfferType]Offers we are requesting consent for
qReturn :: URIThe URL that the user's browser will be returned to upon consenting
qPolicy :: URIThe URL to your site's privacy policy
qContext :: Maybe StringAny state your application wants to preserve through the authentication process
qMarket :: Maybe StringThe locale for the request
consentQuery :: [OfferType] -> URI -> URI -> ConsentQuerySource
Generate a consent query with the minimum information filled in
getConsentUrl :: App -> POSIXTime -> ConsentQuery -> URISource

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
consentUrl :: URISource
The base consent URL for consent requests
Processing a Delegated Authentication consent response
processConsentToken :: MonadError e m => App -> String -> m ConsentTokenSource
Extract and validate an encrypted consent token. This function does not check to see if the token has expired.
data Offer Source
An offer type along with an expiration time
Constructors
Offer
offerExp :: POSIXTime
offerType :: OfferType
show/hide Instances
data ConsentToken Source
The parsed consent token
Constructors
ConsentToken
delt :: DelegationToken
reft :: RefreshToken
skey :: String
offers :: [Offer]
expiration :: POSIXTime
lid :: String
show/hide Instances
type DelegationToken = StringSource
type RefreshToken = StringSource
Produced by Haddock version 2.6.0