azure-acs-0.0.1.1: Windows Azure ACS

Copyright(c) Hemanth Kapila, 2014
LicenseBSD3
Maintainersaihemanth@gmail.com
StabilityExperimental
Safe HaskellNone
LanguageHaskell2010

Network.MicrosoftAzure.ACS

Contents

Description

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 Network.MicrosoftAzure.ACS
import Network.HTTP.Conduit
import Network.HTTP.Client.Conduit
import Network.Connection (TLSSettings (..))
import qualified Data.ByteString.Char8 as C

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

Synopsis

Types

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.

Instances

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

functions

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