HealthVault ASP.NET MVC configuration changes

 
This section describes the changes that are necessary to the default ASP.NET MVC web.config and global.asax.cs files to integrate with HealthVault. 
 
In the web.config file: 
  • Delete the entire <authentication> node
  • Under configuration/system.webServer/modules, add the following line which sets up the HealthVault authentication module:   
<add name="AuthenticationModule" type="Microsoft.Health.Web.Mvc.AuthenticationModule, Microsoft.Health.Web.Mvc" preCondition="managedHandler"/> 
  • In order to use the Visual Studio development server, you’ll need to add a configuration/system.web/httpModules node (if it doesn’t exist), and under that add: 
<add name="AuthenticationModule" type="Microsoft.Health.Web.Mvc.AuthenticationModule"/>   
  • Under configuration/appSettings, add the following standard HealthVault service configs: 
<add key="ApplicationId" value="INSERT App ID" />
<add key="ShellUrl" value="https://account.healthvault-ppe.com/" /> 
<add key="HealthServiceUrl" value="https://platform.healthvault-ppe.com/platform/" /> 
<add key="ApplicationCertificateFileName" value="INSERT absolute path to HealthVault PFX file" /> 
<!-- when we call the SignOut() method on HealthServicePage, it redirects us to the page below --> 
<add key="NonProductionActionUrlRedirectOverride" value="Redirect"/> 
<!-- The redirect page (specified above) uses these keys below to redirect to different pages based on the response from the shell --> 
<add key="WCPage_ActionHome" value="Home"/> 
<add key="WCPage_ActionAppAuthReject" value="Home"/>
<add key="WCPage_SSLForSecure" value="false"/>

In the global.asax.cs file:

  • Add a using statement for Microsoft.Health.Web.Mvc
  • In the RegisterRoutes() method, before the default route, register the routes to the HealthVault controllers with the following: 
 HealthVault.RegisterRoutes(routes)

Last edited Oct 25, 2012 at 6:37 AM by ali_emami, version 30

Comments

No comments yet.