tokenUrl = tokenUrl.replace("%contextRoot%", this.contextRoot);
tokenUrl = tokenUrl.replace("%origin%", this.authority.getOrigin());
tokenUrl = tokenUrl.replace("%scheme%", this.authority.getScheme());
}
final OAuth2Provider oauth2Provider = new OAuth2Provider();
oauth2Provider.setName(providerName);
oauth2Provider.setAuthorizationUrl(authorizationUrl);
oauth2Provider.setTokenUrl(tokenUrl);
oauth2Provider.setClientAuthenticationType(clientAuthenticationType);
oauth2Provider.setAuthorizationHeader(authorizationHeader);
oauth2Provider.setUrlParameter(urlParameter);
ret.put(oauth2Provider.getName(), oauth2Provider);
}
} catch (final JSONException e) {
LOG.logp(Level.WARNING, CLAZZ, method, "Exception parsing providers.", e);
throw new OAuth2PersistenceException(e);
}