if (consumerKey != null) {
tenatUser = UserCoreUtil.getTenantLessUsername(consumerKey);
domain = UserCoreUtil.getTenantDomain(OAuthServiceComponent.getRealmService(),
consumerKey);
dao = new OAuthConsumerDAO(IdentityTenantUtil.getRegistry(domain, consumerKey));
OAuthConsumerDO consumerDO = new OAuthConsumerDO();
consumerDO.setConsumerKey(tenatUser);
consumerDO.setConsumerSecret(consumerSecret);
dao.registerOAuthConsumer(consumerDO);
}
}