WebApplicationUtilities Class

A collection of utility functions to help HealthVault web application developers authenticate and perform other actions with HealthVault.

Namespace: Microsoft.Health.Web
Assembly: Microsoft.Health.Web (in Microsoft.Health.Web.dll) Version: (1.15.1003.9505)

public static class WebApplicationUtilities

If possible, it is recommended that HealthVault applications derive from HealthServicePage. If the requirements for the application don't allow for derivation due to deriving from another base class or needing access from control classes, the static utility methods in this class give the developer access to the same functionality that is available in the HealthServicePage.

Methods like PageOnInit(HttpContext, Boolean) and PageOnPreLoad(HttpContext, Boolean, Boolean) should be called from the application's page OnInit(EventArgs) and OnPreLoad(EventArgs) methods respectively.

Other methods help the application with management of the HealthVault cookie. For instance, LoadPersonInfoFromCookie(HttpContext) reads the HealthVault cookie from the request and instantiates the PersonInfo instance for the logged in person. Note, some methods like LoadPersonInfoFromCookie(HttpContext) require another method be called first to handle the user's authentication token. Methods like SavePersonInfoToCookie(HttpContext, PersonInfo) and RefreshAndSavePersonInfoToCookie(HttpContext, PersonInfo) deal with storing the HealthVault user information in a cookie or session.