Customizing HealthVault Redirection

HealthVault

The HealthServiceActionPage gives you a mechanism
(ActionUrl)
by which you can declaratively define pages handling various HealthVault
shell targets. However, developers frequently run into situation where
they need a more dynamic way of redirecting and handling shell targets.
A simple scenario is if you want users to come back to the URL they
clicked after being authorized by HealthVault shell: For example, the
user clicks and returns to
https://www.healthapp.com/username/stats
instead of going to the default home
https://www.healthapp.com/username/.

Here is a code snippet that illustrates how to extend the
HealthServiceActionPage:

The magic is in the OnActionApplicationAuthorizationSuccessful method, which allows us to override the authorization successful target. The HealthVault SDK HealthServiceActionPage now provides us several OnAction methods that could be used to override the particular APPAUTH targets.