locked
Previliges Changes RRS feed

  • Question

  • Hi,

    I have created an new application in HealthVault PPE. And i have added the this application to my account using configuration page of healthvault.After When i try to connect to my account using browser it was asked for select the record and i selected the one record.Now i want to access the another record.

    1) how can i change the record?
    2) Can we give priviliges to all records present in my account?
    3) If i didnt added the application to my account cant we access the data?

    Please clear me these questions.

    Thanks,
    OM
    Tuesday, October 27, 2009 1:21 PM

Answers


  • 1.  You can make add more record authorizations to the application by doing additional APPAUTH redirections to HealthVault

    void AuthorizeMore()
            {
                StringBuilder sb = new StringBuilder(128);
    
                sb.Append("appid=");
                sb.Append(WebApplicationConfiguration.AppId.ToString());
                sb.Append("&actionqs=");
                sb.Append(HttpUtility.UrlEncode(String.Concat(
                    "redirect=",
                    HttpUtility.UrlEncode(Request.Url.PathAndQuery))));
    
                (Page as HealthServicePage).RedirectToShellUrl(
                    "APPAUTH",
                    sb.ToString());
    
            }
    
    
    



    2.  Yes, you can acheive it by doing Multiple redirections (using APPAUTH) code above, or configuring your application an MRA (Multi REcord App).  Read more on this here. If you have configured your application as MRA and assuming that makes sense, you will see checkboxes instead of radio button the record selection page and you can authorizme more than one record in a go.

    3.  No, you cant access the data "using the application" if you have not authorized it to access the record.


    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Tuesday, October 27, 2009 2:02 PM
  • THere is nothing specific that you need to do to "Configure" an application as MRA.

    There are 2 things you need to do

    a.  Add the IsMra option when redirectiing to Shell using AUTH or APPAUTH. So the earlier code would become:

    http://msdn.microsoft.com/en-us/healthvault/cc265056.aspx

    void AuthorizeMore()
            {
                StringBuilder sb = new StringBuilder(128);
    
                sb.Append("appid=");
                sb.Append(WebApplicationConfiguration.AppId.ToString());
    
    
                sb.Append("&ismra=True");
    
    
                sb.Append("&actionqs=");
                sb.Append(HttpUtility.UrlEncode(String.Concat(
                    "redirect=",
                    HttpUtility.UrlEncode(Request.Url.PathAndQuery))));
    
                (Page as HealthServicePage).RedirectToShellUrl(
                    "APPAUTH",
                    sb.ToString());
    
            }
    


    Note that if you redirect as above, you cannot depend on PersonInfo.SelectedREcord property anymore (it will be null).  Your application should have logic to figure the correct record (from the PersonInfo.AuthorizedRecords collection) for each call to HealthVault.


    HTH




    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Tuesday, October 27, 2009 3:22 PM
  • I agree with Raj that an MRA application makes more sense for you.

    You can find another explanation of MRA here.
    Tuesday, October 27, 2009 5:29 PM

All replies


  • 1.  You can make add more record authorizations to the application by doing additional APPAUTH redirections to HealthVault

    void AuthorizeMore()
            {
                StringBuilder sb = new StringBuilder(128);
    
                sb.Append("appid=");
                sb.Append(WebApplicationConfiguration.AppId.ToString());
                sb.Append("&actionqs=");
                sb.Append(HttpUtility.UrlEncode(String.Concat(
                    "redirect=",
                    HttpUtility.UrlEncode(Request.Url.PathAndQuery))));
    
                (Page as HealthServicePage).RedirectToShellUrl(
                    "APPAUTH",
                    sb.ToString());
    
            }
    
    
    



    2.  Yes, you can acheive it by doing Multiple redirections (using APPAUTH) code above, or configuring your application an MRA (Multi REcord App).  Read more on this here. If you have configured your application as MRA and assuming that makes sense, you will see checkboxes instead of radio button the record selection page and you can authorizme more than one record in a go.

    3.  No, you cant access the data "using the application" if you have not authorized it to access the record.


    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Tuesday, October 27, 2009 2:02 PM
  • Hi Rajesh,

                      Thanxs for reply.
                     

                2) For configuring the application for multiple records, I seen the link given by u.It says that we need to call the RedirectToLogOn method before login. How can i call this method? or can u please explain me how to configure the application as an MRA application.

                    And also Please tell me the how to give the privileges to newly added records list.

    Thanks,
    OM
                
    Tuesday, October 27, 2009 3:13 PM
  • THere is nothing specific that you need to do to "Configure" an application as MRA.

    There are 2 things you need to do

    a.  Add the IsMra option when redirectiing to Shell using AUTH or APPAUTH. So the earlier code would become:

    http://msdn.microsoft.com/en-us/healthvault/cc265056.aspx

    void AuthorizeMore()
            {
                StringBuilder sb = new StringBuilder(128);
    
                sb.Append("appid=");
                sb.Append(WebApplicationConfiguration.AppId.ToString());
    
    
                sb.Append("&ismra=True");
    
    
                sb.Append("&actionqs=");
                sb.Append(HttpUtility.UrlEncode(String.Concat(
                    "redirect=",
                    HttpUtility.UrlEncode(Request.Url.PathAndQuery))));
    
                (Page as HealthServicePage).RedirectToShellUrl(
                    "APPAUTH",
                    sb.ToString());
    
            }
    


    Note that if you redirect as above, you cannot depend on PersonInfo.SelectedREcord property anymore (it will be null).  Your application should have logic to figure the correct record (from the PersonInfo.AuthorizedRecords collection) for each call to HealthVault.


    HTH




    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Tuesday, October 27, 2009 3:22 PM
  • I agree with Raj that an MRA application makes more sense for you.

    You can find another explanation of MRA here.
    Tuesday, October 27, 2009 5:29 PM