locked
Child apps RRS feed

  • Question

  • I just want to make sure were on the right course for creating Child Apps.

    1. a New Certificate is created with private keys for the new child app.

    2. This certificate is passed to  

         appInfo.PublicKeys.Add(GetPublicKeyFromPfxOrP12(

         "C:\EZNotesChildApp.cer")) the creation of the child app.

    3 A dopu or vtr meaningful use response from the child app would be done using the new child app application ID?

    I am still getting a certificate error on the reading the private keys. I just want to make sure the 3 steps are the correct.

    Thanks,

    Scott



    Friday, October 10, 2014 10:14 PM

Answers

  • Hi Scott,

    When you are provisioning a child application programmatically you must include the public key for that specific child application at that time. It looks like you were adding the public keys to the master application and not adding the public key at the time you provisioned the child application.

    -Sean

    Wednesday, October 22, 2014 3:34 PM

All replies

  • Hi Scott,

    MU2 reports are always associated with the application ID that contributes the CCDA. Make sure your CCDA upload process is using the child app ID (and associated private key on your end), and when you're requesting the report, you're using the child app ID (and associated private key).

    Another thing to be aware of is that setting the "Application requires access to Meaningful Use reports" in the Child App settings of the ACC portal, specifies that the master app may provision child apps with this access. When you create the child application, you must specify the methods the child app can invoke. If you're using the .NET SDK, you will use AddApplication to create the child app, and set the callable methods using the CallableMethods property to values in the HealthVaultMethods enum.

    Tuesday, October 14, 2014 7:39 PM
  • Thanks for your help, but something is not right here.  Here is my code to create a child application:

    Dim args As OurHVItems = New OurHVItems()

            args.Appid = Guid.Parse("9d06d418-c797-42e9-a38a-4fabe44163b9")

            args.ServiceUrl = "https://platform.healthvault-ppe.com/platform"

            Dim offlineConnection As New OfflineWebApplicationConnection(args.Appid, args.ServiceUrl, Guid.Empty)

            offlineConnection.Authenticate()

            Dim appInfo As New ApplicationInfo()

     

            Try

                If strChildAppName <> "" Then

                    appInfo.Name = strChildAppName

                Else

                    appInfo.Name = "EZNotes"

                End If

                appInfo.AuthorizationReason = "Cool child application needs authorization to improve your health"

                appInfo.Description = "Cool child application can help you change our lifestyle"

                appInfo.DomainName = "localhost"

                appInfo.LargeLogo = New ApplicationBinaryConfiguration("C:\certfiedlogo120-60.jpg", "image/gif")

                appInfo.ConfigurationOptions = ApplicationOptions.[Default]

                Dim master_certname As String = "WildcatApp-9d06d418-c797-42e9-a38a-4fabe44163b9"    'eznotes

                appInfo.PublicKeys.Add(GetPublicKeyFromPfxOrP12("C:\Users\Russ\Desktop\10-10-14 HealthVault\_HealthVault\Health Vault\bin\Debug\WildcatApp-9d06d418-c797-42e9-a38a-4fabe44163b9.cer"))

                appInfo.PrivacyStatement = New ApplicationBinaryConfiguration(New MemoryStream(UTF8Encoding.[Default].GetBytes("Everything is secret")), "text/plain")

                appInfo.TermsOfUse = New ApplicationBinaryConfiguration(New MemoryStream(UTF8Encoding.[Default].GetBytes("Abuse is strictly prohibited")), "text/plain")

            Catch ex As Exception

                MessageBox.Show(ex.ToString)

            Finally

                Dim rules As New List(Of AuthorizationSetDefinition)()

                rules.Add(DirectCast(New TypeIdSetDefinition(Microsoft.Health.ItemTypes.CCD.TypeId), AuthorizationSetDefinition))

                Dim rule1 As New AuthorizationRule(HealthRecordItemPermissions.All, rules, Nothing)

                appInfo.OfflineBaseAuthorizations.Add(rule1)

            End Try

     

            ' making child app

            Dim newId As New Guid

            Try

                newId = Provisioner.AddApplication(offlineConnection, appInfo)

            Catch ex As Exception

                MessageBox.Show(ex.Message, "Error Creating Child Account", MessageBoxButtons.OK, MessageBoxIcon.Error)

            End Try

     

     

    The New ID stored, when I try and make a new offline connection using the newId, it fails saying I do not have the certificate.

    Microsoft.Health.HealthServiceAccessDeniedException: The signature of the request could not be found.

    When using this:

    Dim conn As OfflineWebApplicationConnection = New OfflineWebApplicationConnection(newId, args.ServiceUrl, Guid.Empty)

     For the life of me, I can not figure out what is wrong here.  The only thing I can possibly think of is that the Guid.Empty should actually be the newId for this user/office/etc?

    and replace the newId with 9d06d418-c797-42e9-a38a-4fabe44163b9.

     So it should say Dim conn As OfflineWebApplicationConnection = New OfflineWebApplicationConnection("9d06d418-c797-42e9-a38a-4fabe44163b9", args.ServiceUrl, newId)

     This would then allow this specific offce to have their own calculations for MU2 etc.

    Wednesday, October 15, 2014 7:32 PM
  • Hi Scott,

    Can you please send the full stack trace for the exception to hvtech@microsoft.com ?

    Thanks

    -Sean

    Monday, October 20, 2014 5:14 PM
  • Hi Sean,
      
     This is the full stack trace error you asked for:

     at Microsoft.Health.EasyWebRequest.WaitForCompletion() in e:\bt\157\private\prod\src\sdk\core\EasyWebRequest.cs:line 746
       at Microsoft.Health.EasyWebRequest.Fetch(Uri url) in e:\bt\157\private\prod\src\sdk\core\EasyWebRequest.cs:line 202
       at Microsoft.Health.EasyWebRequest.Fetch(Uri url, IEasyWebResponseHandler customHandler) in e:\bt\157\private\prod\src\sdk\core\EasyWebRequest.cs:line 243
       at Microsoft.Health.HealthServiceRequest.ExecuteInternal() in e:\bt\157\private\prod\src\sdk\core\HealthServiceRequest.cs:line 327
       at Microsoft.Health.HealthServiceRequest.Execute() in e:\bt\157\private\prod\src\sdk\core\HealthServiceRequest.cs:line 298
       at Microsoft.Health.Authentication.Credential.MakeCreateTokenCall(String methodName, Int32 version, HealthServiceConnection connection, ApplicationTokenCreationInfo applicationTokenCreationInfo, String stsOriginalUrl) in e:\bt\157\private\prod\src\sdk\core\Authentication\Credential.cs:line 530
       at Microsoft.Health.Authentication.Credential.MakeCreateTokenCall(String methodName, Int32 version, HealthServiceConnection connection, Guid appId, Boolean isMra) in e:\bt\157\private\prod\src\sdk\core\Authentication\Credential.cs:line 405
       at Microsoft.Health.Authentication.Credential.CreateAuthenticatedSessionToken(HealthServiceConnection connection, Guid appId) in e:\bt\157\private\prod\src\sdk\core\Authentication\Credential.cs:line 355
       at Microsoft.Health.Web.Authentication.WebApplicationCredential.AuthenticateKeySetPair(AuthSessionKeySetPairs keySetPairs, HealthServiceConnection connection, Guid applicationId, X509Certificate2 certificate) in e:\bt\157\private\prod\src\sdk\core\Authentication\WebApplicationCredential.cs:line 1166
       at Microsoft.Health.Web.Authentication.WebApplicationCredential.AuthenticateKeySetPair(HealthServiceConnection connection, Guid applicationId, X509Certificate2 certificate) in e:\bt\157\private\prod\src\sdk\core\Authentication\WebApplicationCredential.cs:line 1095
       at Microsoft.Health.Web.Authentication.WebApplicationCredential.Authenticate(HealthServiceConnection connection, Guid applicationId) in e:\bt\157\private\prod\src\sdk\core\Authentication\WebApplicationCredential.cs:line 482
       at Microsoft.Health.Web.Authentication.WebApplicationCredential.AuthenticateIfRequired(HealthServiceConnection connection, Guid applicationId) in e:\bt\157\private\prod\src\sdk\core\Authentication\WebApplicationCredential.cs:line 449
       at Microsoft.Health.HealthServiceRequest.Execute() in e:\bt\157\private\prod\src\sdk\core\HealthServiceRequest.cs:line 293
       at Microsoft.Health.Package.ConnectPackageHelper.CreateConnectPackage() in e:\bt\157\private\prod\src\sdk\core\PatientConnect\ConnectPackageHelper.cs:line 100
       at Microsoft.Health.PlatformPrimitives.HealthVaultPlatformPatientConnect.CreateConnectPackage(ConnectPackageCreationParameters creationParameters, PasswordProtectedPackage connectPackage, IEnumerable`1 packageContentsBlobUrls) in e:\bt\157\private\prod\src\sdk\core\HealthVaultPlatformPatientConnect.cs:line 501
       at Microsoft.Health.HealthVaultPlatform.CreateConnectPackage(ConnectPackageCreationParameters creationParameters, PasswordProtectedPackage connectPackage, IEnumerable`1 packageContentsBlobUrls) in e:\bt\157\private\prod\src\sdk\core\HealthVaultPlatform.cs:line 2531
       at Microsoft.Health.Package.ConnectPackage.CreatePackageWithContentsAllParameters(ConnectPackageCreationParameters creationParameters, IEnumerable`1 packageContents) in e:\bt\157\private\prod\src\sdk\core\PatientConnect\ConnectPackage.cs:line 325
       at Microsoft.Health.Package.ConnectPackage.Create(OfflineWebApplicationConnection connection, String friendlyName, String securityQuestion, String securityAnswer, String applicationPatientId, IList`1 packageContents) in e:\bt\157\private\prod\src\sdk\core\PatientConnect\ConnectPackage.cs:line 136
       at Health_Vault.ckSendCCD.DropOff(DopuArguments args, OfflineWebApplicationConnection conn, HealthRecordItem item) in D:\Corporate\Project\_HealthVault\Health Vault\Form1.vb:line 435
      

    No e:\bt\157\private... folder on my pc developing this 


    Thanks,
     
    Scott

    Tuesday, October 21, 2014 10:29 PM
  • Hi Scott,

    When you are provisioning a child application programmatically you must include the public key for that specific child application at that time. It looks like you were adding the public keys to the master application and not adding the public key at the time you provisioned the child application.

    -Sean

    Wednesday, October 22, 2014 3:34 PM
  • Sean, I've run into this issue as well.  Do we need to add both the Master and the Child public keys?
    Monday, December 15, 2014 4:00 PM
  • Here's the message I get when trying to access the offline app: The specified certificate, CN=WildcatApp-426e1e9d-4baf-4c46-950d-58fc0e195d20, could not be found in the LocalMachine certificate store,or the certificate does not have a private key

    Monday, December 15, 2014 4:29 PM