Invalid access token

468 views
Skip to first unread message
Assigned to Fenil....@cerner.com by me

Michal Kormaňák

unread,
Apr 20, 2021, 11:17:52 AM4/20/21
to Cerner FHIR Developers
Hi guys, 

I am trying to run my application in cerner sandbox. I already created new provider application in cerner sandbox. 
In my client application which is implemented in angular. I am using fhirclient library because it handles lots of stuff automatically. 

Currently I am possible run my application from Cerner sandbox. I guess that authorization process is successful because the server will send the access token back and also redirection working properly, but if I want to use this access token to get patient info from the FHIR server I will retrieve unauthorized response from FHIR server.

{
    "resourceType": "OperationOutcome",
    "issue": [
        {
            "severity": "error",
            "code": "login",
            "diagnostics": "Bearer realm=\"fhir-ehr-code.cerner.com\", error=\"invalid_token\"",
            "location": [
                "http.Authorization"
            ]
        }
    ]
}

Launch app:
SMART.authorize({   
      clientId :"bacad00e-2fa4-48a6-9372-26ce70f0d16d",
      scope    : "patient/Patient.read patient/Observation.read launch online_access openid fhirUser",
      redirectUri : "http://localhost:4200/cdslung/?PatientId=12742400",           
  });

index app:
 SMART.ready()
            .then(client => {
                const token = client.getAuthorizationHeader();
                console.log(token);
                client.request(`/Patient/${client.getPatientId()}`);            
            })
            .then(
                (patient) => {
                    console.log(patient);
                },
                error => {
                    console.error(error);
                }); 

I guess that problem should be in my scope settings.
Codes and console app are attached.


Thanks & Regards
Have a nice day guys

 

consoleApp.PNG
indexApp.PNG
launchApp.PNG

kristof....@gmail.com

unread,
Apr 20, 2021, 12:20:04 PM4/20/21
to Cerner FHIR Developers
Same issue here... 
I think the issue is at Cerner's side, because 
I was able to do a succesful call at "Tue, 20 Apr 2021 11:49:56 GMT" (requestId 39564ca2-9d86-4761-8265-f466c68854d8), 
but an identical call failed at Tue, 20 Apr 2021 16:05:17 GMT (requestId: 0801702f-cb95-4c5a-93ef-73a2df5b9da0)
Identical request through Postman.

The token request itself worked, it's the /Patient query that throws a 401.

Regards,
Kristof.


Op dinsdag 20 april 2021 om 17:17:52 UTC+2 schreef kormanak...@gmail.com:

Fenil Desani (Cerner)

unread,
Apr 20, 2021, 2:19:06 PM4/20/21
to Cerner FHIR Developers
Hello,

We are currently looking into this!

Thanks,
Fenil (Cerner)

Fenil Desani (Cerner)

unread,
Apr 20, 2021, 9:30:38 PM4/20/21
to Cerner FHIR Developers
Our recent attempt to fix this did not work. We continue to troubleshoot this further and will keep you posted!

Kristof Taveirne

unread,
Apr 21, 2021, 1:32:13 AM4/21/21
to 'Jenni Syed (Cerner)' via Cerner FHIR Developers
Thank you for the update!


--
You received this message because you are subscribed to a topic in the Google Groups "Cerner FHIR Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cerner-fhir-developers/YZiSQQggjW4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cerner-fhir-devel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cerner-fhir-developers/e98ea744-8220-4dc0-861c-ff140b24c2b3n%40googlegroups.com.

Quintonn

unread,
Apr 21, 2021, 3:14:28 AM4/21/21
to Cerner FHIR Developers
Hi,
I am having similar issues.
I created a SMART app that works as a standalone patient launch app.
Last week everything worked fine and since Monday I'm not able to get patient info after redirecting.
And in the browser console log I can see the FHIR client attempts to get a new token about 5 times before failing. Also it seems to be refreshing my page a number of times.
Actually the first time it gets a good token but after that i get "invalid_grant" errors.

Also, i attempted to run an older version of this app I had and it also doesn't work anymore.

Does all of this sound like it might be related to the things you are working on right now or is it my app that has some problem?
I've spent the last 3 days trying to debug my app but I feel like it might not be my app.

Thanks

Fenil Desani (Cerner)

unread,
Apr 22, 2021, 2:33:09 AM4/22/21
to Cerner FHIR Developers
This is still being worked upon at our highest priority!
As of now it seems to be affecting only DSTU2 version. Please try using R4 in the interim, if possible.

Thanks,
Fenil

Michal Kormaňák

unread,
Apr 22, 2021, 3:48:05 AM4/22/21
to Cerner FHIR Developers
Yes, R4 working correctly.

Thanks,
Michal

Dátum: štvrtok 22. apríla 2021, čas: 8:33:09 UTC+2, odosielateľ: Fenil Desani (Cerner)

Fenil Desani (Cerner)

unread,
Apr 26, 2021, 9:53:49 AM4/26/21
to Cerner FHIR Developers
This is still being worked upon at our highest priority!
As of now it seems to be affecting only DSTU2 version. Please try using R4 in the interim, if possible.

Thanks,
Fenil

Quintonn

unread,
May 9, 2021, 4:31:05 AM5/9/21
to Cerner FHIR Developers
Hi,

I ran into this problem too.
I switched over to R4 and it was working.

But today I am getting the same errors on R4.
I am preparing for a demonstration on SMART on FHIR and this is making me quite nervous.

Is the R4 endpoint having issues too now?

Felix Shen

unread,
May 11, 2021, 10:45:24 PM5/11/21
to Cerner FHIR Developers

i am also getting the invalid_token on R4 ,  it runs correctly before.....  please help.
i also need to do demonstration....

Fenil Desani (Cerner)

unread,
May 13, 2021, 2:55:15 PM5/13/21
to Cerner FHIR Developers
Hello All,

We were troubleshooting this issue since past week and are now able to recreate this issue internally. We seem to have found the root-cause, where certain API calls, both for DSTU2 and R4, are failing.
We have engaged the relevant parties to mitigate the issue.

While we are aware of the impacts of this on your daily work, we are trying to resolve the issue ASAP. Thank you all for your patience!

Will Braynen

unread,
Jul 3, 2021, 2:52:12 PM7/3/21
to Cerner FHIR Developers

Any status update?

We are still getting a 401 on both DSTU2 and R4.

Fenil Desani (Cerner)

unread,
Jul 12, 2021, 3:33:21 PM7/12/21
to Cerner FHIR Developers
Hello,

The issue mentioned above has been resolved.
If you are still facing problems, I would suggest creating a new thread and providing the X-Request-Id.

Thank You,
Fenil (Cerner)

Reply all
Reply to author
Forward
0 new messages