azure-acs- Windows Azure ACS

Copyright(c) Hemanth Kapila, 2014
Safe HaskellNone




DEPRECATED Use Network.MicrosoftAzure.ACS instead.

Provides API to request password token from WindowsAzure ACS. The security token is needed by web applications and services that handle authentication using ACS. Please refer to ACS Management Service API for further information on ACS.

Following piece of code illustrates the use of API

import Web.WindowsAzure.ACS 
import Network.HTTP.Conduit 
import Network.HTTP.Client.Conduit
import Network.Connection (TLSSettings (..))
import qualified Data.ByteString.Char8 as C
import Control.Concurrent

main = do
     acsCtx <- acsContext (AcsInfo "blahblah-sb" (C.pack "" ) (C.pack "owner") (C.pack "blahBlahBlahBlah"))
     manager <- newManagerSettings (mkManagerSettings (TLSSettingsSimple True False False) Nothing)
     t1 <- acsToken manager acsCtx
     print t1



Acs Info

data AcsInfo Source

AcsInfo encapsulates the information needed to get the token from Azure ACS:

  • acs namespace
  • the relying party address
  • the issuer and
  • the issuer key.


Acs Context

data AcsContext Source

An abstract datatype that keeps track of acs token expiry and gets a new one as necessary.

type AcsToken = Header Source

synonym for the ACS password token


acsContext :: AcsInfo -> IO AcsContext Source

construct the context object. This call does not perform any network call yet.

acsToken :: Manager -> AcsContext -> IO AcsToken Source

If a valid token is available, it is returned. Otherwise, requests password a fresh password token from windows azure acs

Refer to HTTP Conduit for information about creating and using Manager