GSOC 2017 - OAuth Module and FHIR SMART Apps integration - Final Presentation

Tags: #<Tag:0x00007f75155ac698> #<Tag:0x00007f75155ac5d0>

Project wiki : https://wiki.openmrs.org/display/projects/FHIR+OAuth+Smart+Apps+Integration+and+OAuth+module+enhancements

Mentor - Mayank Sharma @maany Backup Mentor - Harsha Kumara @harsha89

Work Done :-

1. Migration to OpenMRS 2.x The module previously ran on OpenMRS 1.11 and worked with Spring Security 3. My initial task was to migrate the module to OpenMRS 2.x and use Spring 4 and Spring Security 4. This part took a lot longer that what me and Mayank thought. Spring Security is a complex framework and it’s compatibility issues with Spring versions are many. I had to remove all the deprecated code with new code and also fix some broken part of the code. A lot had changed from OpenMRS 1.11 to 2.X So I had to redo the whole OAuth Client data model and re-write some portions of the client.

2. Fix Grant Types This was one of the most challenging portions of the summer. The code was in-place, the procedure was right. Problem? Can’t get tokens :frowning: In my opinion, Spring Security, Spring Security OAuth are excellent frameworks but quite complex too. Spring uses Jackson to manage all output JSON requests. The tokens which were created and stored in the database, were not returned to the REST call response. Reason? Jackson. Jackson, Spring security oauth, Spring security and spring mvc taken altogether to do one thing created such a mess of finding the right version of everything. If I changed a version, thing X would break. Changing it back, would break Y. This cycle continued for some time, until I managed to find the right versions of everything.

3. UI Fix The previous module used UI extensively. Our initial plan was to scrap out the UI and introduce a controller to manage everything what UI did. However, the mid-term presentation came by and I had nothing other than token generation to show to the community. Then, we decided to keep the UI, make the presentation and later provide enough flexibility to the end-user to choose between REST based controller, UI or both :slight_smile: So I fixed everything wrong in the UI and completed it for the demo during mid-term.

You can take a look at how the UI works here,

4. REST Controller After the mid-terms the point of focus was the REST Controller. Using this controller, one could create, manage, view oauth clients without the UI. Which means that any OWA, Android app, iOS app, etc would be able to manage, create oauth clients and it won’t require opening OpenMRS on a browser and handing everything. Just like almost everything in this summer, the controller didn’t go as planned :stuck_out_tongue: Problem? I wanted to return a client object as JSON response, however Jackson (which handles JSON outputs in Spring) gave the error “property leading to cycles”. Upon research I realized that Jackson depends on getter and setter methods of a class. My client inherited properties such as getCreator() , getVoidedBy() from the BaseOpenMrsData. getCreator() returns a User, the User also has a getCreator(), so that formed an infinite loop whenever getCreator() was called by Jackson. So what I did next was that I broke this loop by creating a new JacksonMappableClient. And now everyone was happy :smile:

A demo of the REST controller can be seen here;

5. SMART Application
This was one of the main goals for the summer. Even if we managed to create the OAuth module, there was not a lot of application to it. SMART on FHIR is a perfect use-case for our module. So making a sample SMART on FHIR would give OpenMRS community a perfect use-case for our module. The application came by easily. Their were a few blockers but nothing which would consume ‘days’ of debugging.

A demo of SMART on FHIR;

Blog My weekly blogposts can be seen on planet.openmrs.org and www.sanatt.me

My OpenMRS experience One simple word AMAZING!! I am glad that every thing didn’t work as planned :stuck_out_tongue:Because honestly, when I look back now, nothing feels better than being stuck at something and trying hard to solve it. I didn’t just learn Spring Security, JavaScript, AJAX, etc this summer, I learned “how to solve problems”. A big shout-out to @maany, nothing would’ve been possible without his support and guidance. His impact on my learning was massive. The code I had to work on was written by him, and unknowingly, he taught me how to write clean and re-usable code. We talked almost everyday, either on VoIP or IM. I must say, it was a pleasure working with him and knowing him. Thanks a lot…!! The community experience was amazing. One thing I loved the most about working with OpenMRS was the community. It’s so easy to find help here. The OpenMRS community is supportive and friendly which makes it very enjoyable to work here. Thanks a lot to everyone who guided me on the way :slight_smile:

Where can you find my code? I am working with Mayank on final documentation and hopefully the code will be pushed to the official repo soon. I’ll post a link here. However, if anyone is interested, you can check my own repo here

4 Likes

Thank you for your contributions @mavrk :). Keep up your good work.

1 Like

@mavrk @maany shall we ask for repo creation?

1 Like

The code works. I’ll probably sit with @mavrk this weekend to clean it up. We can start repo creation and code migration on Monday. @harsha89 does that work? @mavrk let me know what time you would be available on the weekend :slight_smile:

2 Likes

Sounds good @maany

Hi @maany @harsha89, Let’s do this on Saturday (anytime which suits you).

HI, I tried deploying the Oauth2 module with standalone platform 2.6.1 and ran into the below issue. @mavrk can you please point me to the right repo? I am using https://github.com/mavrk/openmrs-module-oauth2-prototype/tree/oauth2-openmrs-2.x and running into issue building the omod.

Running org.openmrs.module.oauth2.api.ClientRegistrationServiceTest
Tests run: 11, Failures: 0, Errors: 11, Skipped: 0, Time elapsed: 6.011 sec <<< FAILURE!
registerNewClient_shouldRegisterNewClientAndCreateForiegnKeyForCollectionFields(org.openmrs.module.oauth2.api.ClientRegistrationServiceTest)  Time elapsed: 0.006 sec  <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
	at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:94)
	at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:72)
	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)
	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
	at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:200)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:252)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:254)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:217)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:83)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:68)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:163)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:file:/Users/kswarna/.m2/repository/org/openmrs/api/openmrs-api/2.2.0-SNAPSHOT/openmrs-api-2.2.0-SNAPSHOT-tests.jar!/org/openmrs/annotation/OpenmrsProfileWithoutTest1Module.class]; nested exception is java.lang.ArrayIndexOutOfBoundsException: 1
	at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:303)
	at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:248)
	at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:87)
	at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:74)
	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1427)
	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1417)
	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:174)
	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:144)
	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:100)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:510)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
	at org.springframework.test.context.support.GenericGroovyXmlContextLoader.loadBeanDefinitions(GenericGroovyXmlContextLoader.java:59)
	at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:122)
	at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
	at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:109)
	at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:261)
	at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:68)
	at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:86)
	... 32 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
	at org.openmrs.annotation.OpenmrsProfileExcludeFilter.matchOpenmrsProfileAttributes(OpenmrsProfileExcludeFilter.java:68)
	at org.openmrs.annotation.OpenmrsProfileExcludeFilter.match(OpenmrsProfileExcludeFilter.java:45)
	at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.isCandidateComponent(ClassPathScanningCandidateComponentProvider.java:341)
	at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:280)
	... 54 more

HI, @mavrk @maany I am trying to build the Oauth2 module to deploy in Openmrs standalone 2.6 version and running into an issue. I am currently using the repo - https://github.com/mavrk/openmrs-module-oauth2-prototype/tree/oauth2-openmrs-2.x. can you please point me to the correct repository?

[INFO] ------------------------------------------------------------------------
[INFO] Building Oauth2 Module API 0.8
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ oauth2-api ---
[INFO] Deleting /Users/kswarna/Documents/openmrs/gitroot/openmrsauth/openmrs-module-oauth2-prototype/api/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ oauth2-api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 8 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.1:compile (default-compile) @ oauth2-api ---
[INFO] Compiling 26 source files to /Users/kswarna/Documents/openmrs/gitroot/openmrsauth/openmrs-module-oauth2-prototype/api/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ oauth2-api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.1:testCompile (default-testCompile) @ oauth2-api ---
[INFO] Compiling 2 source files to /Users/kswarna/Documents/openmrs/gitroot/openmrsauth/openmrs-module-oauth2-prototype/api/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ oauth2-api ---
[INFO] Surefire report directory: /Users/kswarna/Documents/openmrs/gitroot/openmrsauth/openmrs-module-oauth2-prototype/api/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.openmrs.module.oauth2.api.ClientRegistrationServiceTest
Tests run: 11, Failures: 0, Errors: 11, Skipped: 0, Time elapsed: 4.866 sec <<< FAILURE!
registerNewClient_shouldRegisterNewClientAndCreateForiegnKeyForCollectionFields(org.openmrs.module.oauth2.api.ClientRegistrationServiceTest)  Time elapsed: 0.005 sec  <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
	at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:94)
	at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:72)
	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)
	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
	at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:200)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:252)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:254)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:217)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:83)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:68)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:163)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:file:/Users/kswarna/.m2/repository/org/openmrs/api/openmrs-api/2.2.0-SNAPSHOT/openmrs-api-2.2.0-SNAPSHOT-tests.jar!/org/openmrs/annotation/OpenmrsProfileWithoutTest1Module.class]; nested exception is java.lang.ArrayIndexOutOfBoundsException: 1
	at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:303)
	at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:248)
	at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:87)
	at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:74)
	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1427)
	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1417)
	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:174)
	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:144)
	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:100)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:510)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
	at org.springframework.test.context.support.GenericGroovyXmlContextLoader.loadBeanDefinitions(GenericGroovyXmlContextLoader.java:59)
	at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:122)
	at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
	at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:109)
	at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:261)
	at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:68)
	at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:86)
	... 32 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
	at org.openmrs.annotation.OpenmrsProfileExcludeFilter.matchOpenmrsProfileAttributes(OpenmrsProfileExcludeFilter.java:68)
	at org.openmrs.annotation.OpenmrsProfileExcludeFilter.match(OpenmrsProfileExcludeFilter.java:45)
	at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.isCandidateComponent(ClassPathScanningCandidateComponentProvider.java:341)
	at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:280)
	... 54 more

Hey @rajswarnam, can you try the oauth2-pure-rest branch.

1 Like

Thanks @Manny. I tried the oauth2-pure-rest branch and running into new issues. Any ideas ? Please let me know.

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[WARNING] 'dependencies.dependency.exclusions.exclusion.artifactId' for org.springframework.security:spring-security-core:jar with value '/*' does not match a valid id pattern. @ org.openmrs.module:oauth2-api:[unknown-version], /Users/kswarnam/Documents/openmrs/gitroot/openmrsauth/openmrs-module-oauth2-prototype/api/pom.xml, line 160, column 33
[WARNING] 'dependencies.dependency.exclusions.exclusion.artifactId' for org.springframework.security:spring-security-web:jar with value '/*' does not match a valid id pattern. @ org.openmrs.module:oauth2-api:[unknown-version], /Users/kswarnam/Documents/openmrs/gitroot/openmrsauth/openmrs-module-oauth2-prototype/api/pom.xml, line 175, column 33
[ERROR] 'dependencies.dependency.version' for com.fasterxml.jackson.core:jackson-databind:jar is missing. @ org.openmrs.module:oauth2-api:[unknown-version], /Users/kswarnam/Documents/openmrs/gitroot/openmrsauth/openmrs-module-oauth2-prototype/api/pom.xml, line 184, column 21
[WARNING] 'dependencies.dependency.exclusions.exclusion.artifactId' for org.springframework.security:spring-security-config:jar with value '/*' does not match a valid id pattern. @ org.openmrs.module:oauth2-api:[unknown-version], /Users/kswarnam/Documents/openmrs/gitroot/openmrsauth/openmrs-module-oauth2-prototype/api/pom.xml, line 196, column 33
[WARNING] 'dependencyManagement.dependencies.dependency.exclusions.exclusion.artifactId' for org.springframework.security.oauth:spring-security-oauth2:jar with value '/*' does not match a valid id pattern. @ org.openmrs.module:oauth2:0.8, /Users/kswarnam/.m2/repository/org/openmrs/module/oauth2/0.8/oauth2-0.8.pom, line 195, column 37
[WARNING] 'dependencyManagement.dependencies.dependency.exclusions.exclusion.artifactId' for org.springframework.security:spring-security-core:jar with value '/*' does not match a valid id pattern. @ org.openmrs.module:oauth2:0.8, /Users/kswarnam/.m2/repository/org/openmrs/module/oauth2/0.8/oauth2-0.8.pom, line 259, column 37
[WARNING] 'dependencyManagement.dependencies.dependency.exclusions.exclusion.artifactId' for org.springframework.security:spring-security-web:jar with value '/*' does not match a valid id pattern. @ org.openmrs.module:oauth2:0.8, /Users/kswarnam/.m2/repository/org/openmrs/module/oauth2/0.8/oauth2-0.8.pom, line 275, column 37
[WARNING] 'dependencyManagement.dependencies.dependency.exclusions.exclusion.artifactId' for org.springframework.security:spring-security-config:jar with value '/*' does not match a valid id pattern. @ org.openmrs.module:oauth2:0.8, /Users/kswarnam/.m2/repository/org/openmrs/module/oauth2/0.8/oauth2-0.8.pom, line 291, column 37
[WARNING] 'dependencyManagement.dependencies.dependency.exclusions.exclusion.artifactId' for org.springframework.security:spring-security-taglibs:jar with value '/*' does not match a valid id pattern. @ org.openmrs.module:oauth2:0.8, /Users/kswarnam/.m2/repository/org/openmrs/module/oauth2/0.8/oauth2-0.8.pom, line 306, column 37
[ERROR] 'dependencies.dependency.version' for com.fasterxml.jackson.core:jackson-databind:jar is missing. @ org.openmrs.module:oauth2-omod:[unknown-version], /Users/kswarnam/Documents/openmrs/gitroot/openmrsauth/openmrs-module-oauth2-prototype/omod/pom.xml, line 53, column 21
[WARNING] 'dependencies.dependency.exclusions.exclusion.artifactId' for org.springframework.security:spring-security-taglibs:jar with value '/*' does not match a valid id pattern. @ org.openmrs.module:oauth2-omod:[unknown-version], /Users/kswarnam/Documents/openmrs/gitroot/openmrsauth/openmrs-module-oauth2-prototype/omod/pom.xml, line 65, column 33
[WARNING] 'dependencyManagement.dependencies.dependency.exclusions.exclusion.artifactId' for org.springframework.security.oauth:spring-security-oauth2:jar with value '/*' does not match a valid id pattern. @ org.openmrs.module:oauth2:0.8, /Users/kswarnam/.m2/repository/org/openmrs/module/oauth2/0.8/oauth2-0.8.pom, line 195, column 37
[WARNING] 'dependencyManagement.dependencies.dependency.exclusions.exclusion.artifactId' for org.springframework.security:spring-security-core:jar with value '/*' does not match a valid id pattern. @ org.openmrs.module:oauth2:0.8, /Users/kswarnam/.m2/repository/org/openmrs/module/oauth2/0.8/oauth2-0.8.pom, line 259, column 37
[WARNING] 'dependencyManagement.dependencies.dependency.exclusions.exclusion.artifactId' for org.springframework.security:spring-security-web:jar with value '/*' does not match a valid id pattern. @ org.openmrs.module:oauth2:0.8, /Users/kswarnam/.m2/repository/org/openmrs/module/oauth2/0.8/oauth2-0.8.pom, line 275, column 37
[WARNING] 'dependencyManagement.dependencies.dependency.exclusions.exclusion.artifactId' for org.springframework.security:spring-security-config:jar with value '/*' does not match a valid id pattern. @ org.openmrs.module:oauth2:0.8, /Users/kswarnam/.m2/repository/org/openmrs/module/oauth2/0.8/oauth2-0.8.pom, line 291, column 37
[WARNING] 'dependencyManagement.dependencies.dependency.exclusions.exclusion.artifactId' for org.springframework.security:spring-security-taglibs:jar with value '/*' does not match a valid id pattern. @ org.openmrs.module:oauth2:0.8, /Users/kswarnam/.m2/repository/org/openmrs/module/oauth2/0.8/oauth2-0.8.pom, line 306, column 37
[WARNING] 'dependencyManagement.dependencies.dependency.exclusions.exclusion.artifactId' for org.springframework.security.oauth:spring-security-oauth2:jar with value '/*' does not match a valid id pattern. @ line 207, column 37
[WARNING] 'dependencyManagement.dependencies.dependency.exclusions.exclusion.artifactId' for org.springframework.security:spring-security-core:jar with value '/*' does not match a valid id pattern. @ line 271, column 37
[WARNING] 'dependencyManagement.dependencies.dependency.exclusions.exclusion.artifactId' for org.springframework.security:spring-security-web:jar with value '/*' does not match a valid id pattern. @ line 287, column 37
[WARNING] 'dependencyManagement.dependencies.dependency.exclusions.exclusion.artifactId' for org.springframework.security:spring-security-config:jar with value '/*' does not match a valid id pattern. @ line 303, column 37
[WARNING] 'dependencyManagement.dependencies.dependency.exclusions.exclusion.artifactId' for org.springframework.security:spring-security-taglibs:jar with value '/*' does not match a valid id pattern. @ line 318, column 37
 @ 
[ERROR] The build could not read 2 projects -> [Help 1]
[ERROR]   
[ERROR]   The project org.openmrs.module:oauth2-api:0.8 (/Users/kswarnam/Documents/openmrs/gitroot/openmrsauth/openmrs-module-oauth2-prototype/api/pom.xml) has 1 error
[ERROR]     'dependencies.dependency.version' for com.fasterxml.jackson.core:jackson-databind:jar is missing. @ org.openmrs.module:oauth2-api:[unknown-version], /Users/kswarnam/Documents/openmrs/gitroot/openmrsauth/openmrs-module-oauth2-prototype/api/pom.xml, line 184, column 21
[ERROR]   
[ERROR]   The project org.openmrs.module:oauth2-omod:0.8 (/Users/kswarnam/Documents/openmrs/gitroot/openmrsauth/openmrs-module-oauth2-prototype/omod/pom.xml) has 1 error
[ERROR]     'dependencies.dependency.version' for com.fasterxml.jackson.core:jackson-databind:jar is missing. @ org.openmrs.module:oauth2-omod:[unknown-version], /Users/kswarnam/Documents/openmrs/gitroot/openmrsauth/openmrs-module-oauth2-prototype/omod/pom.xml, line 53, column 21
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

@maany I fixed the jackson version error in pom.xml and now running into a new error. This is kind of bizarre

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.1:compile (default-compile) on project oauth2-omod: Compilation failure: Compilation failure: 
[ERROR] /Users/kswarnam/Documents/openmrs/gitroot/openmrsauth/openmrs-module-oauth2-prototype/omod/src/main/java/org/openmrs/module/oauth2/web/controller/ClientManagementController.java:[51,63] error: diamond operator is not supported in -source 1.6
[ERROR] 
[ERROR]   (use -source 7 or higher to enable diamond operator)
[ERROR] /Users/kswarnam/Documents/openmrs/gitroot/openmrsauth/openmrs-module-oauth2-prototype/omod/src/main/java/org/openmrs/module/oauth2/web/controller/MetadataController.java:[25,48] error: diamond operator is not supported in -source 1.6
[ERROR] -> [Help 1]

I updated the POM.xml source and target from 1.6 to 1.8, but for some reason I still see the same error. Any thoughts on what I might be missing?

Hey @rajswarnam I worked on the module and I’ll be able to assist you. However, I am on a vaccation right now and I’ll be free from 17th.

Did you try 1.7? Because, the module was developed and checked on 1.7. Also, please note : If you change java versions, please make sure that all other dependencies have the versions which are compatible to the java version you changed to.

@mavrk, I was able to get it to work. I had to change ClientManagementController.java line 51 and MetaData Control.java line 25 to include a parameter in <> operator. Thanks again for your help.