-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Plugin-1741] SuccessFactors - OAuth2 Implementation #34
base: develop
Are you sure you want to change the base?
[Plugin-1741] SuccessFactors - OAuth2 Implementation #34
Conversation
37869a0
to
4083f5d
Compare
ed6fb11
to
6989161
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase the changes, resolve the conflicts and ensure build is green.
@@ -0,0 +1,391 @@ | |||
/* | |||
* Copyright © 2022 Cask Data, Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please update year in the license.
<dependency> | ||
<groupId>org.apache.httpcomponents</groupId> | ||
<artifactId>httpclient</artifactId> | ||
<version>${httpclient.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.opensaml</groupId> | ||
<artifactId>xmltooling</artifactId> | ||
<version>1.4.4</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.opensaml</groupId> | ||
<artifactId>openws</artifactId> | ||
<version>1.5.4</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.opensaml</groupId> | ||
<artifactId>opensaml</artifactId> | ||
<version>2.6.4</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>commons-codec</groupId> | ||
<artifactId>commons-codec</artifactId> | ||
<version>1.10</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>xml-security</groupId> | ||
<artifactId>xmlsec</artifactId> | ||
<version>1.3.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>commons-collections</groupId> | ||
<artifactId>commons-collections</artifactId> | ||
<version>3.2.2</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>commons-lang</groupId> | ||
<artifactId>commons-lang</artifactId> | ||
<version>2.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>commons-logging</groupId> | ||
<artifactId>commons-logging</artifactId> | ||
<version>1.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.velocity</groupId> | ||
<artifactId>velocity</artifactId> | ||
<version>1.5</version> | ||
<type>pom</type> | ||
</dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are the versions of these dependencies decided?
Is the same code being used somewhere in any other existing plugin?
Please add comments for every dependency where it is used.
"property": "authType", | ||
"operator": "equal to", | ||
"value": "basicAuth" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
authType
will be null
in existing pipelines since it is a newly added config.
We should default to basicAuth
when authType
is also null
.
tokenURL, clientId, privateKey, userId, samlUsername, assertionToken, | ||
companyId, authType, assertionTokenType, filterOption, selectOption, | ||
expandOption, additionalQueryParameters, paginationType); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation looks off here.
if (config.getConnection().getAuthType().equals(SuccessFactorsConnectorConfig.BASIC_AUTH)) { | ||
failureCollector.addFailure(errMsg, null).withConfigProperty(SuccessFactorsPluginConfig.UNAME); | ||
failureCollector.addFailure(errMsg, null).withConfigProperty(SuccessFactorsPluginConfig.PASSWORD); | ||
} else { | ||
failureCollector.addFailure(errMsg, null).withConfigProperty(SuccessFactorsConnectorConfig.COMPANY_ID); | ||
failureCollector.addFailure(errMsg, null).withConfigProperty(SuccessFactorsConnectorConfig.CLIENT_ID); | ||
if (config.getConnection().getAssertionTokenType().equals(SuccessFactorsConnectorConfig.ENTER_TOKEN)) { | ||
failureCollector.addFailure(errMsg, null). | ||
withConfigProperty(SuccessFactorsConnectorConfig.ASSERTION_TOKEN); | ||
} else { | ||
failureCollector.addFailure(errMsg, null).withConfigProperty(SuccessFactorsConnectorConfig.PRIVATE_KEY); | ||
failureCollector.addFailure(errMsg, null).withConfigProperty(SuccessFactorsConnectorConfig.USER_ID); | ||
failureCollector.addFailure(errMsg, null).withConfigProperty(SuccessFactorsConnectorConfig.TOKEN_URL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constants should always be used first in java to avoid NPE in equals
condition.
For example,
if (SuccessFactorsConnectorConfig.BASIC_AUTH.equals(config.getConnection().getAuthType())) {....}
this.authType = authType; | ||
return this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
authType
will be null
for existing pipelines.
It should default to BASIC_AUTH
in that case.
Implement Oauth 2.0 support in SAP Successfactors Batch Source Plugin. SAP SuccessFactors supports OAuth 2.0 to authenticate OData API and SFAPI users. Compared with HTTP Basic Auth, OAuth 2.0 is considered to be more secure in that it doesn't require users to provide their passwords during authentication. With OAuth 2.0, you can also use a third-party identity provider (IDP) for user management and provisioning.
https://cdap.atlassian.net/browse/PLUGIN-1741