locked
How to achieve user authentication to Health Vault account in webmethod? RRS feed

  • Question

  • Hi,

     

    I am working on Proof of Concept that allows user's health records to be updated in Microsoft Health Vault through my mobile application. The application will get/send the data from/to Health vault account.

     
    My role is to write a webservice that will expose the Health dlls. My webmethods will handle the following:
    -->authenticate the user when he connects to his Health Vault account through my application.
    -->Get the health records of the user to be displayed on his mobie device.
    -->Add the data entered by user to be stored in Health Vault.
     
    I understand that login to Health vault account requires Windows Live ID. I need to know how to make a connection to Health Vault server and validate Windows Live ID credentials in my webmethod. Give me the exact steps to be followed. It would be helpful if you can give me the the exact methods to be called along with the parameters.
     
    Let me know If there is a different way to achieve authentication.
     
    Thanks,
    Sowmya
    Monday, April 14, 2008 9:51 AM

Answers

  • Sowmya,

     

    The scenario that you describe would best be handled through offline access.

     

    The last message on this post has a decent description of how it works. We are releasing a "direct to clinical" extension that will make it possible to do the hookup without having to write a web application.

     

    Let me know if you have more questions after reading that.

    Monday, April 14, 2008 8:30 PM
  • There is an offline sample in the current SDK. I think it has the code that you are looking for.

     

    Thursday, April 17, 2008 4:24 PM

All replies

  • Sowmya,

     

    The scenario that you describe would best be handled through offline access.

     

    The last message on this post has a decent description of how it works. We are releasing a "direct to clinical" extension that will make it possible to do the hookup without having to write a web application.

     

    Let me know if you have more questions after reading that.

    Monday, April 14, 2008 8:30 PM
  • I am looking for the steps that will be required to setup for my web application to interact with the HealthVault in OFFLINE mode. If shared with a sample then that will be great... Thanks.
    Thursday, April 17, 2008 3:52 PM
  • There is an offline sample in the current SDK. I think it has the code that you are looking for.

     

    Thursday, April 17, 2008 4:24 PM
  • Hi Sowmya,

       This is Sri and I need to do exactly what you had mentioned. But I have to do this in Java. Did you find the answer to authenticate the user when he connects to his Health Vault account through your application? Even I have to authenticate through mobile and when I tried to do that without browser I'm getting a warning "Javascript required to login". Could you please assist me if you had found the solution.

        Also I found that we can work on offline but I guess that also requires atleast one online login.

    Thanks,
    Sri.
    Wednesday, February 24, 2010 3:22 PM
  • Hi Sowmya,

    I am not sure if you have got answer to your question.  But, I recently developed a webpage and also a web service individually as follows:

    1.  Connecting clinical system database with the Healthvault.
    2.  Linking User between my application and Healthvault. (Authenticating).
    3.  Unlinking the user. (Removing cliniical system appplicaiton permissions for the HV user profile ).
    4.  Uploading realtime vital signs from clinical system database that can be in any database sqlserver, oracle, mysql, etc to Healthvault User profile.
    5.  Reading Healthvault user profile information and all the vital signs from the Healthvaul use rprofile and displaying it over to the clinical application.

    The Mobile application of miine calls the webservice methods that I had provided and rest everything happens on my server.

    All the catch is in OfflineWebapplication Access and the Unique personID associated to the user healthvaul profile.  If you have the persion id, of specific healthvault user account, you can do everyting .

    Here is what I did.
    On first time access of the applicaiton, since you will not have the person id available on your end, you must create offline connection and redirect the user to logon page from your application.
    User will then see the healthvaul login screen wherein they can login and allow accces to to your application.  Once they selet Allow Access to a specific profile or multiple profiles, you will be redirected back to your application to the page you configured in web.config where you can see the personIDs authenticated.  You must store these peson ids in your database and use it everytime whenever you want to upload that specific user health record from your application to the Healthvault applicaiton.

    Here is the simple example that I used frm SDK, this is in C#. So, alter it according to your needs.


                offlineConn = new OfflineWebApplicationConnection(new Guid(personID));
                offlineConn.Authenticate();
                offlineConn.OfflinePersonId = new Guid(personID);
                try
                {
                    MPersonInfo = offlineConn.GetPersonInfo();
                    if (MPersonInfo.SelectedRecord == null)
                    {
                        RedirectToLogOn();
                        return;

                     }

           
                }
                catch (HealthServiceException  ex)
                {
                    RedirectToLogOn();
                    return;
                }

    You may redirect back to the same page and and check for the this.PersonInfo to read the person id of the HV user profile:

     MPersonInfo = this.PersonInfo;
                if (MPersonInfo != null)
                {

    personID = MPersonInfo.PersonId.ToString ();    
                     //Do offline authentication with the person id to make sure you can access the user profile from your app
                    offlineConn = new OfflineWebApplicationConnection(new Guid(personID));
                   
                    offlineConn.Authenticate();
                    offlineConn.OfflinePersonId = new Guid(personID);
                     
                    MPersonInfo = offlineConn.GetPersonInfo();

                    //If succeeds store the person id for the specific applicatio nuser in your database and you can use it from next time onwards.

                   SavePersonID(personID);
                }

    e.g. to Upload Blood Oxygen for a given user person id after making authentication:

    void SaveBloodOxygenToHealthVault(DataRow currentRow)
        {
            try
            {           
                BloodOxygenSaturation PatientBloodOxygen = new BloodOxygenSaturation();
                PatientBloodOxygen.Value = Convert.ToDouble (BloodOxygenValue) / 100;                       
                PatientBloodOxygen.When = new HealthServiceDateTime(DateTime.Now);           
                PatientBloodOxygen.CommonData.Note = RecordNotes;

                MPersonInfo.SelectedRecord.NewItem(PatientBloodOxygen);
                PatientBloodOxygen = null;
            }
            catch (Exception ex)
            {

            }
        }

    There are many more objects in the HV DataTypes you can use to upload any data and everything works great.

    Hopefully I have answered your question...

    Thanks
    --ARun

    Thursday, April 29, 2010 6:52 PM