Child pages
  • OAuth2 Module - Run module with LegacyUI only

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.

In the current state, OAuth2 module is purely REST based.

To enable UI features such as Admin dashboard, Client registration form, etc. implement the following things : 

Add dependency for Legacy UI module in /omod/src/main/java/resources/config.xml file

Code Block



Also, create the following class to support XML changes

Code Block
 * The contents of this file are subject to the OpenMRS Public License
 * Version 1.0 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
package org.openmrs.module.oauth2.extension.html;

import org.openmrs.module.Extension;
import org.openmrs.module.web.extension.AdministrationSectionExt;

import java.util.LinkedHashMap;
import java.util.Map;

 * This class defines the links that will appear on the administration page under the
 * "oauth2.title" heading.
public class AdminList extends AdministrationSectionExt {

	 * @see AdministrationSectionExt#getMediaType()
	public Extension.MEDIA_TYPE getMediaType() {
		return Extension.MEDIA_TYPE.html;

	 * @see AdministrationSectionExt#getTitle()
	public String getTitle() {
		return "oauth2.title";

	 * @see AdministrationSectionExt#getLinks()
	public Map<String, String> getLinks() {
		LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
		map.put("module/oauth2/registeredClient/index.htm", "oauth2.manage.registered");
		return map;



All other UI functionality exists in the module (smile)