none
The credential token has expired

    Question

  • Why HealthVault Application Configuration Center is throwing The credential token has expired. Here a complete error message.
    https://config.healthvault-ppe.com/
    I have checked all Certficates and all are valid to Dec 30th.
    1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

      <%@ Page Language="C#" Debug="true" %>

    or:

    2) Add the following section to the configuration file of your application:

    <configuration>
       <system.web>
           <compilation debug="true"/>
       </system.web>
    </configuration>


    I don't know where to add above config files. I am using  HealthVault Application Manager that i downloaded from HealthVault. Please help me how to fix this problem. Thank you in advance.
    Addisu
    Monday, November 23, 2009 3:02 PM

Answers

  • I have changed it to Medication V1. Are you getting any error when you are trying to change or add a new data type in Application Configuration Center?
    Please wait for 30 minutes and reauthorize the application.
    -Mahesh
    • Marked as answer by Addisalem Tuesday, December 01, 2009 10:07 PM
    Tuesday, December 01, 2009 9:08 PM

All replies

  • Hello Addisalem,

    Have you gone through the samples that came with HealthVault SDK with the path (C:\Program Files\Microsoft HealthVault\SDK\DotNet\WebSamples). Opening the sample in .Net, you can find aspx page and web.config file where you can see the above section that you are searching for.
    Also please go through the documentation provided if you have not gone through.

    Please refer to our MSDN HealthVault Developer Center, and in particular, the Getting Started guide and How-To Guides, to get more information and will be helpful for you in developing the applications.
    -Mahesh
    Monday, November 23, 2009 3:57 PM
  • If you are getting Credential token expired error, close the browser (all instances), clear all cookies and browse again.

    Raj
    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Tuesday, November 24, 2009 4:43 AM
  • You guys are Awesome (Rajesh and Mahesh). I could able to see my certificates.
    Mahesh,
    I checked only Medication(V1) was not checked. There some unnormal behaviour between Certificate am usin and applicationId.
    I have checked other certificates and all have an applicationId with WildCatApp- removed  but with the certificate i am using, it is a bit different.
    Here is a cetificate:

    WildcatApp-1427bc2a-e17f-46a7-a8ce-8bbb86d9e33a

    Here is an applicationId:
    9cb92397-0c51-4833-9401-878a77cfad2f
    Is this a normal behaviour. I am gussing this might have cased a problem so far. Please advise me about this thing.
    Thanks,
    Addisu

    Tuesday, November 24, 2009 5:37 AM
  • This is what i am using.

    <

     

    add key="ApplicationId" value="1427bc2a-e17f-46a7-a8ce-8bbb86d9e33a"/>

    <

     

    add key="ShellUrl" value="https://account.healthvault-ppe.com/"/>

    <

     

    add key="HealthServiceUrl" value="https://platform.healthvault-ppe.com/platform/"/>

    <

     

    add key="AppCertSubject" value="WildcatApp-1427bc2a-e17f-46a7-a8ce-8bbb86d9e33a"/>

    When i navigate using HealthVault Applciation Configuration Center, ApplicationID for corresponding certificates is as follows:
    Certificate: WildcatApp-1427bc2a-e17f-46a7-a8ce-8bbb86d9e33a
    ApplicationID: 9cb92397-0c51-4833-9401-878a77cfad2f

    Please take a look at this too.
    Thanks,
    Addisu

    Tuesday, November 24, 2009 5:46 AM
  • Can you explain the scenario correctly? What are you navigating for? Are you saying about HealthVault Application Manager or Application Configuration Center.

    As you said you are right, Medication V1 is not checked for your Online Access but Medication and Medication V1 is checked for Offline Access for the App ID 1427bc2a-e17f-46a7-a8ce-8bbb86d9e33a


    -Mahesh
    Tuesday, November 24, 2009 4:11 PM
  • Mahesh,
    We are seeing two different values i think. In my HealhtVault Configuration Center, I could see Medications and Medications V1  are checked for Online Access but for Offline Access only Medications is checked for applicationID 1427bc2a-e17f-46a7-a8ce-8bbb86d9e33a. Can you please uncheck Medications V1 for me? I am using Offline Access and i think this  what causing type cast mismatch error.
    Thanks a lot,
    Addisu
    Tuesday, November 24, 2009 5:02 PM
  • As per your request, I have unchecked Medication V1 for Offline Access. Can you verify whether you have only Medication for both Online Access and Offline Access. Please note it takes 30 minutes to get the changes affected. Reauthorize the applicaion using http://account.healthvault-ppe.com/ sharing tab for your application.
    -Mahesh
    Tuesday, November 24, 2009 5:48 PM
  • Mahesh,
    I am  workng on Conditions and Medications. Conditions is okay. I could able to retrieve fully. Medications had type cast error.
    Thanks a lot.
    With Best Regards,
    Addisu

    Tuesday, November 24, 2009 6:21 PM
  • Did you reauthorize the application?
    -Mahesh
    Tuesday, November 24, 2009 7:06 PM
  • Mahesh,
    I am very new in working on this sdk. Can you tell me how i can reauthorize the application?
    Thanks,
    Addisu
    Tuesday, November 24, 2009 7:25 PM
  • Here are the steps to follow:

    1. Login to https://account.healthvault-ppe.com
    2. Go to Sharing Tab
    3. Click on your application "APS Healthcare" Change Access link and will redirect to another page
    4. Click on Remove All Access to stop the sharing.
    5. Go to your application and get a Person ID and Record ID to run the application.

    Note: You can go through Eric's Blog, MSDN HealthVault Developer Center, and in particular, the Getting Started guide and How-To Guides to get more information.

    Hope this helps....
    -Mahesh
    Tuesday, November 24, 2009 7:49 PM
  • Mahesh,
    I really appreciated your help. I have Remove  All Access. I ran with PersonID and RecordID. Here is different error:
    Microsoft.Health.HealthServiceAccessDeniedException was caught
      Message="Access is denied."
      Source="Microsoft.Health"
      ErrorCodeId=11
      StackTrace:
           at Microsoft.Health.EasyWebRequest.WaitForCompletion()
           at Microsoft.Health.EasyWebRequest.Fetch(Uri url)
           at Microsoft.Health.EasyWebRequest.Fetch(Uri url, IEasyWebResponseHandler customHandler)
           at Microsoft.Health.HealthServiceRequest.ExecuteInternal()
           at Microsoft.Health.Web.OfflineWebApplicationConnection.ExecuteRequestWithRetry(HealthServiceRequest request)
           at Microsoft.Health.HealthServiceRequest.Execute()
           at Microsoft.Health.HealthRecordSearcher.Execute()
           at Microsoft.Health.HealthRecordSearcher.GetMatchingItems()
           at APS.AI.HealthVaultAdapter.GetHealthVaultItemTypes.GetHealthRecordItemCollection[T](Guid typeID, HealthRecordAccessor offlineAccessor) in C:\APS\APS\APS.AI.HealthVaultAdapter\GetHealthVaultItemTypes.cs:line 53
           at APS.AI.HealthVaultAdapter.GetHealthVaultItemTypes.GetMedications(Guid personId, Guid recordId) in C:\APS\APS\APS.AI.HealthVaultAdapter\GetHealthVaultItemTypes.cs:line 91
           at APS.AI.HealthVaultGateway.DownloadManager.GetMedications(GetMedicationRequest request) in C:\APS\APS\APS.AI.HealthVaultGateway\OperationContracts\DownloadManager.svc.cs:line 63
      InnerException:

    I have given acces to Medications and Conditions. Can take a look at it?
    Thanks,
    Addisu
    Tuesday, November 24, 2009 8:08 PM
  • You need to get a new Person ID and Record ID when you reauthorize your application.

    To get more understanding on this scenario, you can work on the Offline Access sample which is provided by SDK.

    Hope this helps...
    -Mahesh
    Tuesday, November 24, 2009 10:08 PM
  • I have created new  connection and got new PersonID and Record and ran application. The same error occured.
    Here is error:
    System.InvalidCastException was caught
      Message="Unable to cast object of type 'Microsoft.Health.HealthRecordItem' to type 'Microsoft.Health.ItemTypes.Medication'."
      Source="APS.AI.HealthVaultAdapter"
      StackTrace:
           at APS.AI.HealthVaultAdapter.GetHealthVaultItemTypes.GetHealthRecordItemCollection[T](Guid typeID, HealthRecordAccessor offlineAccessor) in C:\APS\APS\APS.AI.HealthVaultAdapter\GetHealthVaultItemTypes.cs:line 58
           at APS.AI.HealthVaultAdapter.GetHealthVaultItemTypes.GetMedications(Guid personId, Guid recordId) in C:\APS\APS\APS.AI.HealthVaultAdapter\GetHealthVaultItemTypes.cs:line 91
           at APS.AI.HealthVaultGateway.DownloadManager.GetMedications(GetMedicationRequest request) in C:\APS\APS\APS.AI.HealthVaultGateway\OperationContracts\DownloadManager.svc.cs:line 63
      InnerException:

    Thanks,
    Addisu
    Tuesday, November 24, 2009 10:30 PM
  • What is the value of Medication.TypeID you are getting?

    If you are developing the application in .Net, here is the sample code:

    List<Medication> medication = GetValues<Medication>(Medication.TypeId);    

    List<T> GetValues<T>(Guid typeID) where T : HealthRecordItem
        {      
            OfflineWebApplicationConnection offlineConn = new OfflineWebApplicationConnection(personId);
            offlineConn.Authenticate();
            HealthRecordAccessor accessor = new HealthRecordAccessor(offlineConn, recordGuid);

            // Get offline records
            HealthRecordSearcher searcher = accessor.CreateSearcher();

            HealthRecordFilter filter = new HealthRecordFilter(typeID);
            filter.View.Sections = HealthRecordItemSections.All;
            searcher.Filters.Add(filter);

            HealthRecordItemCollection items = searcher.GetMatchingItems()[0];

            List<T> typedList = new List<T>();

            foreach (HealthRecordItem item in items)
            {
                typedList.Add((T)item);
            }

            return typedList;
        }


    -Mahesh
    Friday, November 27, 2009 6:38 AM
  • Thanks a lot Mahesh,
    I coppied your code  and ran my application. The same error happened. Here is stack trace:
    System.InvalidCastException was caught
      Message="Unable to cast object of type 'Microsoft.Health.HealthRecordItem' to type 'Microsoft.Health.ItemTypes.Medication'."
      Source="APS.AI.HealthVaultAdapter"
      StackTrace:
           at APS.AI.HealthVaultAdapter.GetHealthVaultItemTypes.GetValues[T](Guid typeID, Guid personId, Guid recordGuid) in C:\APS\APS\APS.AI.HealthVaultAdapter\GetHealthVaultItemTypes.cs:line 99
           at APS.AI.HealthVaultAdapter.GetHealthVaultItemTypes.GetMedications(Guid personId, Guid recordId) in C:\APS\APS\APS.AI.HealthVaultAdapter\GetHealthVaultItemTypes.cs:line 117
           at APS.AI.HealthVaultGateway.DownloadManager.GetMedications(GetMedicationRequest request) in C:\APS\APS\APS.AI.HealthVaultGateway\OperationContracts\DownloadManager.svc.cs:line 63
      InnerException:

    I think l the problem on ApplicationID. Here is my ApplicationID:

    1427bc2a-e17f-46a7-a8ce-8bbb86d9e33a

    Can you check this applicationID whether it has right access to Medications i am requesting or not?
    Best Regards,
    Addisu
    Friday, November 27, 2009 6:32 PM
  • Thanks a lot Mahesh,
    I coppied your code  and ran my application. The same error happened. Here is stack trace:
    System.InvalidCastException was caught
      Message="Unable to cast object of type 'Microsoft.Health.HealthRecordItem' to type 'Microsoft.Health.ItemTypes.Medication'."
      Source="APS.AI.HealthVaultAdapter"
      StackTrace:
           at APS.AI.HealthVaultAdapter.GetHealthVaultItemTypes.GetValues[T](Guid typeID, Guid personId, Guid recordGuid) in C:\APS\APS\APS.AI.HealthVaultAdapter\GetHealthVaultItemTypes.cs:line 99
           at APS.AI.HealthVaultAdapter.GetHealthVaultItemTypes.GetMedications(Guid personId, Guid recordId) in C:\APS\APS\APS.AI.HealthVaultAdapter\GetHealthVaultItemTypes.cs:line 117
           at APS.AI.HealthVaultGateway.DownloadManager.GetMedications(GetMedicationRequest request) in C:\APS\APS\APS.AI.HealthVaultGateway\OperationContracts\DownloadManager.svc.cs:line 63
      InnerException:

    I think  the problem is on ApplicationID. Here are IDs i am using
    Medication.TypeId : 5c5f1223-f63c-4464-870c-3e36ba471def
    PersonId:               75056feb-3c2e-4a00-aa11-7a1eeb65bbb8
    RecordId:               5c09a577-be43-4083-a428-70f4bde65353             
    ApplicationId:         1427bc2a-e17f-46a7-a8ce-8bbb86d9e33a    

    Can you check this applicationID whether it has right access to Medications i am requesting or not?
    Best Regards,
    Addisu

    Friday, November 27, 2009 7:44 PM
  • I have checked your Application ID. You have checked a different version of Medication in Application Configuration Center.

    You can try with Medication.TypeId as 30cafccc-047d-4288-94ef-643571f7919d and run your application or change the version of Medication in Application Configuration Center, wait for 30 minutes to get the changes affected.
    -Mahesh
    Saturday, November 28, 2009 12:53 AM
  • Mahesh,
    I have run my application with Medication.TypeId you sent me but the same error happens. Actually, i used same personId and recordId with this TypeId. Here is stack trace:

    System.InvalidCastException was caught
      Message="Unable to cast object of type 'Microsoft.Health.HealthRecordItem' to type 'Microsoft.Health.ItemTypes.Medication'."
      Source="APS.AI.HealthVaultAdapter"
      StackTrace:
           at APS.AI.HealthVaultAdapter.GetHealthVaultItemTypes.GetValues[T](Guid typeID, Guid personId, Guid recordGuid) in C:\APS\APS\APS.AI.HealthVaultAdapter\GetHealthVaultItemTypes.cs:line 99
           at APS.AI.HealthVaultAdapter.GetHealthVaultItemTypes.GetMedications(Guid personId, Guid recordId) in C:\APS\APS\APS.AI.HealthVaultAdapter\GetHealthVaultItemTypes.cs:line 117
           at APS.AI.HealthVaultGateway.DownloadManager.GetMedications(GetMedicationRequest request) in C:\APS\APS\APS.AI.HealthVaultGateway\OperationContracts\DownloadManager.svc.cs:line 63
      InnerException:

    Please take a look at it.
    Thanks,
    Addisu
    Saturday, November 28, 2009 3:17 AM
  • Thanks Mahesh,
    I have seen this forum thread and try to use this method Eric is suggesting:

    HealthRecordSearcher searcher = PersonInfo.SelectedRecord.CreateSearcher();

    In my instance i cannot use  

    PersonInfo . PersonInfo instance works with cookie stored when a user logs to a HealthVault if i am not mistaken. I tried to use PersonInfo and Object not initialized error was thrown. I couldn't initialize PersonInfo as it doesn't have any constructrors. I need your help about this method please or if you have any other suggestion please help me.
    Best Regards,
    Addisu

    Saturday, November 28, 2009 4:09 PM
  • Eric's blog which I suggested you to describe about the versioning.

    PersonInfo gets the information about the logged in person. Are you developing the application using .Net?
    -Mahesh
    Monday, November 30, 2009 3:37 PM
  • Thanks Mahesh,
    I am using .Net application. I am actually developing web  services for getting Medications, Conditions, Updating Medications and Updating Conditions. My application doesn't have any direct reference with logged in HealthVault pages. That is why i couldn't use PersonInfo. I need your help how to get Medications without using PersonInfo.
    Thanks,
    Addisu
    Monday, November 30, 2009 3:45 PM
  • Mahesh,
    I am still waiting your response for help. Please respond me whenever you can.
    With Best Regards,
    Addisu

    Tuesday, December 01, 2009 4:38 PM
  • Is there a reason you need to call webservices directly as against using the .Net SDK?  If you are using .Net, the recommended way is to use the HealthVault SDK

    Can you please explain the scenario why you are developing web services?
    The above code which I have suggested will work fine without any issue, if you have access to Medication data type using .Net SDK.

    -Mahesh
    Tuesday, December 01, 2009 4:46 PM
  • I am using HealthVault SDK. I am wondering if there is any way i can get Medications without loging to HealthVault. I used to get Medications without any problem with default ApplicationId i used to use. Here is a default one.

    ApplicationId  "85dbe60d-e191-44f8-b387-59bc5269ae8a"

      I created new applicationID and have given OfflineAccess to Medication and Condition but I am getting InvalidCastException error for Medication. The method is the same. The problem is on new applicationId access level. I am getting Conditions without any problem. Here are applicationId

     

     

    ApplicationId "1427bc2a-e17f-46a7-a8ce-8bbb86d9e33a"

    Can you compare if there is any access level difference between these IDs? I don't have any access to check a default one.
    With Best Regards,
    Addisu

    Tuesday, December 01, 2009 5:05 PM
  • The Application ID "85dbe60d-e191-44f8-b387-59bc5269ae8a" has access to Medication V1 while the new App Id has the access to Medication.
    I guess you are trying to get the records using Medication V1 data type, where you do not have access to Medication V1 for the App ID "1427bc2a-e17f-46a7-a8ce-8bbb86d9e33a", and you are getting the type cast error.

    Can you please login to Application Configuration Center and give access to Medication V1 for both offline and online access, remove access to Medication wait for 30 minutes to get the changes affected. Reauthorize the application and get a new Person ID and Record ID when you reauthorize your application.


    -Mahesh
    Tuesday, December 01, 2009 5:15 PM
  • Mahesh, i unchecked Medication and checked Medication V1 for both OfflineAccess and OnlineAccess and waited fo an hour. I  Reauthorize the application and created new PersonId and RecordId and tested application but the same error is thrown again(Unable to cast object of type 'Microsoft.Health.HealthRecordItem' to type 'Microsoft.Health.ItemTypes.Medication'). Here is Id:
    ApplicationId "1427bc2a-e17f-46a7-a8ce-8bbb86d9e33a"
    Can you take a look at it please?
    Thanks,
    Addisu
    Tuesday, December 01, 2009 7:27 PM
  • I have checked your AppId, I could still see Medication as checked and Medication V1 as unchecked. Can you please check it again.
    -Mahesh
    Tuesday, December 01, 2009 7:30 PM
  • I have unchecked it. Can you do me a favor by unchecking it please?
    With Best Regards,
    Addisu

    Tuesday, December 01, 2009 8:00 PM
  • Mahesh,
    I am waiting for you to uncheck it please. I did uncheck but it is not refelected in the HealthVault System.
    Thanks,
    Addisu
    Tuesday, December 01, 2009 8:45 PM
  • I have changed it to Medication V1. Are you getting any error when you are trying to change or add a new data type in Application Configuration Center?
    Please wait for 30 minutes and reauthorize the application.
    -Mahesh
    • Marked as answer by Addisalem Tuesday, December 01, 2009 10:07 PM
    Tuesday, December 01, 2009 9:08 PM
  • I am not getting any error. Changes i made hadn't been reflected in HealthVault as you confirmed. I didn't create this applicationId with my account. My boss created with his account and went to India for vacation. Any changes i make are not reflected in Healthvault. That might be a cause as i am using just a user account to change and modify.
    Thanks a lot,
    Addisu
    Tuesday, December 01, 2009 9:14 PM
  • Thanks Mahesh a lot. I really appreciated the help and effort you put to get my problem get solved. I have been struggling to fix this problem for about 10 days. Any changes i made in my Applcation Configuration Center were not refelected in HealthVault as i am not using the account that is used to create ApplicationId. I hope to see a better documentation from HealthVault addressing these kinds of problems.
    Best Regards,
    Addisu
    Tuesday, December 01, 2009 10:14 PM
  • Hi Mahesh,
    please take a look at this forum thread and suggest me a better approach to resolve the problem.
    http://social.msdn.microsoft.com/Forums/en-US/healthvault/thread/281e2f20-1231-44f0-ac13-1788ca293fec

    Thanks,
    Addisu
    Wednesday, December 02, 2009 11:02 PM
  • Hi Mahesh,
    I have downloaded updated HealthVault SDK and looks okay to work with Medication not Medication V1. Can you please check Medication for OfflineAccess and OnlineAccess and uncheck Medication V1 for
    ApplicationId:         1427bc2a-e17f-46a7-a8ce-8bbb86d9e33a    ?
    If it doesn't work we will switch back.
    With Best Regards,
    Addisu
    Thursday, December 03, 2009 5:20 PM