locked
Determining when a new record is authorized for a MRA RRS feed

  • Question

  • Hi,

    I'm working on a MRA and I'd like to try to find a way to know when a user has authorized a new record for my application.  Ideally I'd like to have the shell tell me via one of it's actions.  I was hoping to use the 'APPAUTH' event, however it looks like it uses the action 'APPAUTHSUCCESS' which is also shared by the AUTH event.  Is there a way that I can get this information from the Shell or the SDK?

    thanks

    joe
    Friday, January 22, 2010 4:44 PM

Answers

  • Hello Joe,

    From my initial look at this issue I could come up with two work around for this.

    One is, while redirecting pass some values for the action query string to differentiate between the AUTH target and the APPAUTH target. Something similar to the following,
    WebApplicationUtilities.RedirectToShellUrl(
                    HttpContext.Current,
                    targetLocation,                     // "AUTH"
                    targetQuery,
                    "AUTH");                             // "APPAUTH" for APPAUTH target
    Then in the action URL page retrieve the action query string and identify the scenario.

    The second option I could come up with is to specify a different target when we redirect to the APPAUTH target.
    Response.Redirect(HealthServiceLocation.GetHealthServiceShellUrl(
                        "APPAUTH",
                        "appid=8f619168-d1f9-400b-bde3-3fafd09a9350&isMRA=TRUE&redirect=http://localhost:51756/website/RedirectTarget.aspx"   // Here change the appid and redirect values accordingly. The string can be created dynamically. I just pasted the one in my sample code.
                        ).OriginalString);

    Please let me know whether this helps you. In the meantime I will look for other options on this.

    Thanks and Regards,
    Aneesh D.
    Saturday, January 23, 2010 3:03 AM
  • If the user is already logged in and you are redirecting to shell for additional authorization, you can always detect if additional records where authorized by comparing the AuthorizedRecords collection before and after redirection.

    Otherwise a heavy weight way to do this may be by using GetAuthorizedPeople API to download and store all the personids and corresponding recordids in localstore.  Then you can compare this data with what AuthorizedRecords collection reports.

    A third way is to give your application id authorization to GroupMembership data type.  Each time a user authorizes a record, an instance of GroupMembership is automatically created - you can use this information to detect what you want.

    In any event, I dont think there is a way direct way to detect a new record authorization during shell redirection

    Raj
    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Monday, January 25, 2010 5:27 PM

All replies

  • Hello Joe,

    From my initial look at this issue I could come up with two work around for this.

    One is, while redirecting pass some values for the action query string to differentiate between the AUTH target and the APPAUTH target. Something similar to the following,
    WebApplicationUtilities.RedirectToShellUrl(
                    HttpContext.Current,
                    targetLocation,                     // "AUTH"
                    targetQuery,
                    "AUTH");                             // "APPAUTH" for APPAUTH target
    Then in the action URL page retrieve the action query string and identify the scenario.

    The second option I could come up with is to specify a different target when we redirect to the APPAUTH target.
    Response.Redirect(HealthServiceLocation.GetHealthServiceShellUrl(
                        "APPAUTH",
                        "appid=8f619168-d1f9-400b-bde3-3fafd09a9350&isMRA=TRUE&redirect=http://localhost:51756/website/RedirectTarget.aspx"   // Here change the appid and redirect values accordingly. The string can be created dynamically. I just pasted the one in my sample code.
                        ).OriginalString);

    Please let me know whether this helps you. In the meantime I will look for other options on this.

    Thanks and Regards,
    Aneesh D.
    Saturday, January 23, 2010 3:03 AM
  • If the user is already logged in and you are redirecting to shell for additional authorization, you can always detect if additional records where authorized by comparing the AuthorizedRecords collection before and after redirection.

    Otherwise a heavy weight way to do this may be by using GetAuthorizedPeople API to download and store all the personids and corresponding recordids in localstore.  Then you can compare this data with what AuthorizedRecords collection reports.

    A third way is to give your application id authorization to GroupMembership data type.  Each time a user authorizes a record, an instance of GroupMembership is automatically created - you can use this information to detect what you want.

    In any event, I dont think there is a way direct way to detect a new record authorization during shell redirection

    Raj
    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Monday, January 25, 2010 5:27 PM