Problem using JQuery with OAuth2 module

Hi! My goal is use FHIR module on OpenMRS Platform and make requests from an external client…

For this I use the OAuth2 module: OAuth2 module

The problem is that when starting the server (with OAuth2 loaded), jquery does not work, for example, to search for patients or search for concepts using ajax.

At home, the errors are: Refused to execute script from ‘http://localhost:8080/openmrs/scripts/openmrsmessages.js?v=2.2.0-${revisionNumber}&locale=es’ because its MIME type (‘text/html’) is not executable, and strict MIME type checking is enabled. Refused to execute script from ‘http://localhost:8080/openmrs/dwr/interface/DWRAlertService.js?v=2.2.0-${revisionNumber}’ because its MIME type (‘text/plain’) is not executable, and strict MIME type checking is enabled.

I attach some images:

How can i fix this? @mavrk @pkatopenmrs

@dmgogorza I recommend you to read this : https://wiki.openmrs.org/display/projects/OAuth2+Module

:slight_smile:

If you want to make requests from an external client, you first have to register the client. For that you can refer this : https://wiki.openmrs.org/display/projects/OAuth2+Module+-+Client+REST+Controller

After you figure these things out, help us with the exact requests that you are making. :slight_smile:

Thanks for your reply! :grinning:

I had read the documentation. I had no problems to create the user, I could also get an access token, executing the URL from a browser.

This happens before any other, that is, when the OAuth module is loaded, I found those errors in all OpenMRS pages.

You can observe in the screen “Buscar Paciente(s)” (Patient search) the “input text” for the search, is not loaded. Does not this happen to you?

Hey @dmgogorza sorry for a late reply.

May i know which modules are you running?

Only FHIR module and OAuth module.

Try running these four modules :

1.webservices.rest

2.legacyUI

3.fhir

4.oauth

See if it resolves your problem. Today i would do a quick check for this and come up with a response. :slight_smile:

The same thing continues to happen.

I ran the test with the following modules:

  1. Rest Web Services OMOD (version 2.22.0.ba95a3)
  2. Legacy UI Module (version 1.4.0, it also happens with 1.5.0-SNAPSHOT)
  3. FHIR Module (version 1.13.1, it also happens with 1.14.0-SNAPSHOT)
  4. Oauth2 Module (version 0.8)

I was finally able to solve this problem.

I had to restore a database without data, and until now it not happened again.

Thank you very much for your time, probably in the next few days I will be with another question related to CORS.

1 Like

That’s cool :slight_smile:

Sure I would try my best to help you out @dmgogorza :slight_smile:.