private static String AUTHORIZE_TOKEN = "OAuth.AuthorizeUrl";
public void registerOAuthConsumer(String consumerSecret) throws Exception {
String tenatUser = null;
String domain = null;
OAuthConsumerDAO dao = null;
String consumerKey = null;
consumerKey = getLoggedInUser();
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);
}
}