WebApplicationUtilities Class

Definition

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

public static class WebApplicationUtilities
Inheritance
WebApplicationUtilities

Remarks

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.

Properties

AnonymousConnection

Gets a HealthVault connection for the configured default HealthVault web-service instance without an authentication token for either the user or the application.

ApplicationAuthenticationCredential

Gets a credential used to authenticate the web application to HealthVault.

ApplicationConnection

Gets a HealthVault application connection without a user context for the configured default HealthVault web-service instance.

DictionaryConnection

Gets a HealthVault connection for the configured default HealthVault web-service instance, without an authentication token for the user but with an application authentication token, which can be used to access vocabularies.

Methods

Compress(String)

Compress incoming string.

Compress(String, Int32)

Compress incoming string.

ConstructShellTargetUrl(HttpContext, ShellRedirectParameters)

Constructs a URL to be redirected to via the HealthVault URL redirector.

ConstructShellTargetUrl(HttpContext, String)

Constructs a URL to be redirected to via the HealthVault URL redirector.

ConstructShellTargetUrl(HttpContext, String, String)

Constructs a URL to be redirected to via the HealthVault URL redirector.

ConstructShellTargetUrl(HttpContext, String, String, String)

Constructs a URL to be redirected to via the HealthVault URL redirector.

Decompress(String)

Decompress a compressed string.

GetAnonymousConnectionForInstance(HealthServiceInstance)

Gets a HealthVault connection for the specified HealthVault web-service instance without an authentication token for either the user or the application.

GetApplicationAuthenticationCredential(Guid)

Gets a credential used to authenticate the web application to Microsoft HealthVault.

GetApplicationConnection(Guid, HealthServiceInstance)

Gets a HealthVault application connection without a user context for the specified HealthVault web-service instance.

GetApplicationConnection(HealthServiceInstance)

Gets a HealthVault application connection without a user context for the specified HealthVault web-service instance.

GetApplicationConnection(Guid)

Gets a HealthVault application connection without a user context for the configured default HealthVault web-service instance.

GetAuthenticatedConnection(HttpContext)

Gets a HealthVault connection for the authenticated user.

GetDictionaryConnectionForInstance(HealthServiceInstance)

Gets a HealthVault connection for the specified HealthVault web-service instance, without an authentication token for the user but with an application authentication token, which can be used to access vocabularies.

GetPersonInfo(String)

Gets the authenticated person's information using the specified authentication token from the configured default HealthVault web-service instance.

GetPersonInfo(String, HealthServiceInstance)

Gets the authenticated person's information using the specified authentication token from the specified HealthVault web-service instance.

GetPersonInfo(String, Guid)

Gets the authenticated person's information using the specified authentication token, from the specified HealthVault web-service instance.

GetPersonInfo(String, Guid, HealthServiceInstance)

Gets the authenticated person's information using the specified authentication token, from the specified HealthVault web-service instance.

GotoHelp(HttpContext, String)

Redirects application to Shell help page

LoadPersonInfoFromCookie(HttpContext)

Gets the person's information from the cookie.

LoadPersonInfoFromCookie(HttpCookie)

Gets the person's information from the cookie.

PageOnInit(HttpContext, Boolean)

Replicates the OnInit(EventArgs) behavior by redirecting to a secure version of the page if the URL requested is insecure and the application requires a secure connection.

PageOnPreLoad(HttpContext, Boolean, Boolean, Guid)

Ensures that the person is logged on if logOnRequired is true.

PageOnPreLoad(HttpContext, Boolean, Guid)

Ensures that the person is logged on if logOnRequired is true.

PageOnPreLoad(HttpContext, Boolean)

Ensures that the person is logged on if logOnRequired is true.

PageOnPreLoad(HttpContext, Boolean, Boolean)

Ensures that the person is logged on if logOnRequired is true.

RedirectToLogOn(HttpContext)

Redirects the caller's browser to the logon page for authentication.

RedirectToLogOn(HttpContext, ShellRedirectParameters)

Redirects the caller's browser to the logon page for authentication.

RedirectToLogOn(HttpContext, Boolean)

Redirects the caller's browser to the logon page for authentication.

RedirectToLogOn(HttpContext, Boolean, String)

Redirects the caller's browser to the logon page for authentication.

RedirectToLogOn(HttpContext, Boolean, String, String)

Redirects the caller's browser to the logon page for authentication.

RedirectToShellUrl(HttpContext, String, String, String)

Redirects to the HealthVault Shell URL with the queryString params appended.

RedirectToShellUrl(HttpContext, ShellRedirectParameters)

Redirects to the HealthVault Shell URL with the query string params appended.

RedirectToShellUrl(HttpContext, String)

Redirects to the HealthVault Shell URL with the query string params appended.

RedirectToShellUrl(HttpContext, String, String)

Redirects to the HealthVault Shell URL with the queryString params appended.

RefreshAndSavePersonInfoToCookie(HttpContext, String, HealthServiceInstance)

Cleans the application's session of HealthVault information and then repopulates it using the specified authentication token and HealthVault web-service instance.

RefreshAndSavePersonInfoToCookie(HttpContext, String)

Cleans the application's session of HealthVault information and then repopulates it using the specified authentication.

RefreshAndSavePersonInfoToCookie(HttpContext, PersonInfo)

Cleans the application's session of HealthVault information and then repopulates it.

SavePersonInfoToCookie(PersonInfo)

Stores the specified person's information in the cookie.

SavePersonInfoToCookie(PersonInfo, HttpCookie)

Stores the specified person's information in the cookie.

SavePersonInfoToCookie(HttpContext, PersonInfo)

Stores the specified person's information in the cookie.

SavePersonInfoToCookie(HttpContext, PersonInfo, Boolean)

Stores the specified person's information in the cookie.

SignOut(HttpContext, String, Guid, String)

Signs the person out, cleans up the HealthVault session information, and redirects the user's browser to the signout action URL with the specified querystring parameter (including user's credential token) if any.

SignOut(HttpContext, String, Guid)

Signs the person out, cleans up the HealthVault session information, and redirects the user's browser to the signout action URL with the specified querystring parameter if any.

SignOut(HttpContext, String, Guid, String, HealthServiceInstance)

Signs the person out, cleans up the HealthVault session information, and redirects the user's browser to the signout action URL with the specified querystring parameter (including user's credential token) if any.

SignOut(HttpContext, Guid)

Signs the person out, cleans up the HealthVault session information, and redirects the user's browser to the signout action URL.

SignOut(HttpContext)

Signs the person out, cleans up the HealthVault session information, and redirects the user's browser to the signout action URL.

SignOut(HttpContext, String)

Signs the person out, cleans up the HealthVault session information, and redirects the user's browser to the signout action URL with the specified querystring parameter if any.

SignOut(HttpContext, String, Guid, String, String)

Signs the person out, cleans up the HealthVault session information, and redirects the user's browser to the signout action URL with the specified querystring parameter (including user's credential token) if any.