Failed to load resource: the server responded with a status of 401 (Unauthorized)

807 views
Skip to first unread message

Mark Mak

unread,
May 10, 2017, 3:54:29 PM5/10/17
to SMART on FHIR
I copied the example from http://docs.smarthealthit.org/tutorials/authorization/ and host it in IIS. Always have the error "sb-auth.smarthealthit.org/auth/token Failed to load resource: the server responded with a status of 401 (Unauthorized)
Survey.html:1 XMLHttpRequest cannot load https://sb-auth.smarthealthit.org/auth/token. Response for preflight has invalid HTTP status code 401".  Any changes do I have to make so that the pages will work? Thanks you.

Travis Cummings

unread,
May 11, 2017, 3:07:59 PM5/11/17
to Mark Mak, SMART on FHIR
Hi Mark,

I was able to run the example app in Tomcat as follows:

1) create a folder within Tomcat's webapps as "smart-demo"
2) copy launch.html and index.html into the "smart-demo" folder
3) Register an app at https://sandbox.smarthealthit.org with these values:
4) Take the client id returned from the sandbox manager and update launch.html with my client id
5) Edit my app registration to use scopes: launch patient/*.read openid profile
6) Launch the app

We can update the default scopes of the app registration to remove step 5.  

Does following these steps allow the app to work for you?

Travis


On Wed, May 10, 2017 at 1:54 PM Mark Mak <mak...@gmail.com> wrote:
I copied the example from http://docs.smarthealthit.org/tutorials/authorization/ and host it in IIS. Always have the error "sb-auth.smarthealthit.org/auth/token Failed to load resource: the server responded with a status of 401 (Unauthorized)
Survey.html:1 XMLHttpRequest cannot load https://sb-auth.smarthealthit.org/auth/token. Response for preflight has invalid HTTP status code 401".  Any changes do I have to make so that the pages will work? Thanks you.

--
You received this message because you are subscribed to the Google Groups "SMART on FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smart-on-fhi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark Mak

unread,
May 11, 2017, 4:49:15 PM5/11/17
to SMART on FHIR, mak...@gmail.com
Hi Travis,

It looks like it's only working with Public Client. It doesn't work with Confidential Client. It's there any way to make it work with Confidential Client? Thank you.

Mark
Reply all
Reply to author
Forward
0 new messages