Where can I download an .omod file for OAuth2 module?

If there’s one, please let me know the URL. The module search page didn’t return any result. Thanks.

Hey here’s the github repository for the oauth2 module. I’ll me making changes to it to make it compatible with platform 2.0 and above today :slight_smile: https://github.com/maany/openmrs-module-oauth2-prototype

for now, please use the 1.11.x branch https://github.com/maany/openmrs-module-oauth2-prototype/tree/oauth2-openmrs-1.11.x

1 Like

Thanks for the pointers. I built the .omod, using 1.11.x branch, then tried to load the module in my OpenMRS 1.11.5 Standalone installation, but the OAuth2 module failed to load. To note just a few of the exceptions I see: Caused by: org.hibernate.AnnotationException: @Column(s) not allowed on a @ManyToOne property: org.openmrs.module.oauth2.Client.changedBy and Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘transactionManager’ defined in class path resource [applicationContext-service.xml]

I’m wondering if I’m missing something. For instance, are there any modules that I should load before loading OAuth2 module? My ultimate goal is to get FHIR resources secured by AOuth2. Is there any documentation that can help me get there? Thanks.

I did face these errors

AFAICR, I modified the files in OpenMRS core locally to get OAuth2 module running. I can send you details as soon as I get a chance (currently travelling).

Load the OAuth2 module first and then the FHIR module. Doing it the other way round messes up with the order spring security filters should be loaded. :slight_smile:

The OAuth2 module works with FHIR well. That’s how I last left it. :slight_smile: To protect more endpoints via the OAuth2 module, all you have to do is create a security:http for that endpoint, similar to

I created the ticket (TRUNK-4841) for the issue that we both encountered (use of @Column with @ManyToOne). This issue was introduced in 1.11.3 and hasn’t been fixed. I believe it was introduced by the use of annotation. Can you promote your fix, since you’ve already done it locally, and close this ticket? At the moment I don’t have a dev env setup for openmrs-core. On the OAuth2 front, I have built and deployed it in OpenMRS 1.11.1 standalone. My next step is to build and install the FHIR module and do some testing. Thanks for your input!

Hi manny, the problem associated with @Column has been fixed and merged in all the affected branches.See:

Three things:

  1. The OAuth2 module still fails to build with any OpenMRS version higher than 1.11.2. You will see the build errors in the above ticket. Are these the issues that you said you have fixed? Will you be promoting your fixes on the master? If yes, any time frame?
  2. I have an OpenMRS 1.11.1 standalone installation and have loaded both oauth2 and FHIR modules in the order you recommended (first oauth2…). Both modules were loaded and started successfully, but it throws an exception when I click on the link to Register New Client; although, it shows me the registration form. Can you point me to any doc or comment on the various fields for the Authorized Grant Types?
  3. In the OAuth2 protocol workflow, which module does the Authentication? Do I need any OpenMRS module in support of Authentication? Thanks!

Hey I’ve been caught up with a conference. I’ll send in the patch to run OAuth2 module on Platform > 1.11.1 asap.

Let me for check any backported commits that might be causing trouble or any additional platform changes required to support the module. :slight_smile: deadline : 1 day, I understand this is important for your proposal! If you can verify that a new client is being created in the database (tables for oauth2 module), you can start using the authorization and token endpoints.

The Oauth2 module does both authentication and authorization. You only require the OAuth2 module to implement OAuth2 support.

A post was split to a new topic: Register a client/app with oAuth2 module