securityContextServiceImpl.setUserDataRetrievalService(userDataRetrievalService);
oauthConnector = new ForceOAuthConnector(userDataRetrievalService);
// Build a ForceOAuthConnectionInfo object, if applicable
ForceOAuthConnectionInfo connInfo = null;
if (config.getInitParameter("endpoint") != null) {
connInfo = new ForceOAuthConnectionInfo();
connInfo.setEndpoint(config.getInitParameter("endpoint"));
connInfo.setOauthKey(config.getInitParameter("oauthKey"));
connInfo.setOauthSecret(config.getInitParameter("oauthSecret"));
oauthConnector.setConnectionInfo(connInfo);
} else if (config.getInitParameter("url") != null) {
connInfo = new ForceOAuthConnectionInfo();
String connectionUrl = config.getInitParameter("url");
if (ForceConnectorUtils.isInjectable(connectionUrl)) {
connectionUrl = ForceConnectorUtils.extractValue(connectionUrl);
if (connectionUrl == null || connectionUrl.equals("")) {
throw new IllegalArgumentException("Unable to load ForceConnectorConfig from environment or system property "
+ config.getInitParameter("url"));
}
}
connInfo.setConnectionUrl(connectionUrl);
oauthConnector.setConnectionInfo(connInfo);
} else if (config.getInitParameter("connectionName") != null) {
oauthConnector.setConnectionName(config.getInitParameter("connectionName"));
} else {
throw new IllegalArgumentException("Could not find any init state for AuthFilter. "