public OAuthConsumerAppDTO[] getAllOAuthApplicationData() throws Exception {
String userName = getLoggedInUser();
String tenatUser = null;
String domain = null;
OAuthAppDAO dao = null;
OAuthAppDO[] apps = null;
OAuthConsumerAppDTO[] dtos = new OAuthConsumerAppDTO[0];
if (userName != null) {
OAuthMetaDataDTO metadata = new OAuthMetaDataDTO();
metadata.setAccessTokenUrl(IdentityUtil.getProperty(ACCESS_TOKEN));
metadata.setAuthorizeUrl(IdentityUtil.getProperty(AUTHORIZE_TOKEN));
metadata.setRequestTokenUrl(IdentityUtil.getProperty(REQUEST_TOKEN));
tenatUser = UserCoreUtil.getTenantLessUsername(userName);
domain = UserCoreUtil
.getTenantDomain(OAuthServiceComponent.getRealmService(), userName);
dao = new OAuthAppDAO(IdentityTenantUtil.getRegistry(domain, userName));
apps = dao.getAllOAuthAppByUser(tenatUser);
if (apps != null && apps.length > 0) {
dtos = new OAuthConsumerAppDTO[apps.length];
OAuthConsumerAppDTO dto = null;
OAuthAppDO app = null;
for (int i = 0; i < apps.length; i++) {