Connecting Sandbox

168 views
Skip to first unread message

Sharon Dang

unread,
May 24, 2021, 2:04:01 PM5/24/21
to CDS Hooks
I am trying to add localhost:3000/cds_services/id as a CDS service to the sandbox, but am getting "Failed to connect to the discovery endpoint. See console for details."

The console doesn't have any additional details. Is the sandbox unable to connect locally? How do I fix this?

dennis.p...@cerner.com

unread,
May 24, 2021, 3:00:18 PM5/24/21
to CDS Hooks
Are you entering your discovery endpoint url into the prompt?  From your message, it looks like you're trying to add an endpoint for a specific service.

dennis.p...@cerner.com

unread,
May 27, 2021, 11:09:34 AM5/27/21
to CDS Hooks
Yes, I believe I am entering the discovery endpoint url (https://avhana.ngrok.io/cds_services/id). 

It sends an OPTION request to our server and there is a route that accepts it, but it oddly redirects to the login page and we get this error "Access to XMLHttpRequest at 'https://avhana.ngrok.io/cds_services/id' from origin 'https://sandbox.cds-hooks.org' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request."

I wouldn't expect your discovery endpoint to end in 'id', based on the defined url structure - https://cds-hooks.hl7.org/1.0/#discovery

Since sandbox.cds-hooks.org is a separate domain from avhana.ngrok.io, you do need to enable CORS on your endpoints to explicitly give permission to be called from a browser which has loaded an alternate domain - https://github.com/cerner/cds-services-tutorial/wiki/Cross-Origin-Resource-Sharing-(CORS)
Reply all
Reply to author
Forward
0 new messages