+ ".consumer_secret");
if (cKey != null && cSecret != null) {
cKey = cKey.trim();
cSecret = cSecret.trim();
LOG.debug("Loading configuration for provider : " + key);
OAuthConfig conf = new OAuthConfig(cKey, cSecret);
conf.setId(key);
conf.setProviderImplClass(providersImplMap.get(key));
if (applicationProperties.containsKey(value
+ ".custom_permissions")) {
String perms = applicationProperties.getProperty(
value + ".custom_permissions").trim();
if (perms.length() > 0) {
conf.setCustomPermissions(perms);
}
}
if (applicationProperties.containsKey(value
+ ".request_token_url")) {
String reqUrl = applicationProperties.getProperty(
value + ".request_token_url").trim();
if (reqUrl.length() > 0) {
conf.setRequestTokenUrl(reqUrl.trim());
}
}
if (applicationProperties.containsKey(value
+ ".authentication_url")) {
String authUrl = applicationProperties.getProperty(
value + ".authentication_url").trim();
if (authUrl.length() > 0) {
conf.setAuthenticationUrl(authUrl.trim());
}
}
if (applicationProperties.containsKey(value
+ ".access_token_url")) {
String tokenUrl = applicationProperties.getProperty(
value + ".access_token_url").trim();
if (tokenUrl.length() > 0) {
conf.setAccessTokenUrl(tokenUrl.trim());
}
}
if (applicationProperties.containsKey(value + ".plugins")) {
String pluginsStr = applicationProperties.getProperty(
value + ".plugins").trim();
if (pluginsStr.length() > 0) {
String plugins[] = pluginsStr.split(",");
if (plugins.length > 0) {
List<String> pluginScopes = new ArrayList<String>();
conf.setRegisteredPlugins(plugins);
for (String plugin : plugins) {
if (applicationProperties.containsKey(plugin
+ ".scope")) {
String pscope = applicationProperties
.getProperty(plugin + ".scope")
.trim();
if (pscope.length() > 0) {
String sarr[] = pscope.split(",");
pluginScopes
.addAll(Arrays.asList(sarr));
}
}
}
if (!pluginScopes.isEmpty()) {
conf.setPluginsScopes(pluginScopes);
}
}
}
}
providersConfig.put(key, conf);