Skip to content

Commit

Permalink
Refactor validateBasicCredentials
Browse files Browse the repository at this point in the history
  • Loading branch information
psainics committed Jan 6, 2025
1 parent 88afe52 commit adfeef1
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public String getBaseURL() {

public void validateBasicCredentials(FailureCollector failureCollector) {

if (BASIC_AUTH.equals(authType)) {
if (BASIC_AUTH.equals(this.getAuthType())) {
if (Strings.isNullOrEmpty(getUsername()) && !containsMacro(UNAME)) {
String errMsg = ResourceConstants.ERR_MISSING_PARAM_PREFIX.getMsgForKey(SAP_SUCCESSFACTORS_USERNAME);
failureCollector.addFailure(errMsg, COMMON_ACTION).withConfigProperty(UNAME);
Expand All @@ -259,9 +259,7 @@ public void validateBasicCredentials(FailureCollector failureCollector) {
String errMsg = ResourceConstants.ERR_MISSING_PARAM_PREFIX.getMsgForKey(SAP_SUCCESSFACTORS_PASSWORD);
failureCollector.addFailure(errMsg, COMMON_ACTION).withConfigProperty(PASSWORD);
}

}
if (OAUTH2.equals(authType)) {
} else {
if (Strings.isNullOrEmpty(getClientId()) && !containsMacro(CLIENT_ID)) {
String errMsg = ResourceConstants.ERR_MISSING_PARAM_PREFIX.getMsgForKey(CLIENT_ID);
failureCollector.addFailure(errMsg, COMMON_ACTION).withConfigProperty(CLIENT_ID);
Expand All @@ -279,7 +277,6 @@ public void validateBasicCredentials(FailureCollector failureCollector) {
failureCollector.addFailure(errMsg, COMMON_ACTION).withConfigProperty(TOKEN_URL);
}


if (ENTER_TOKEN.equals(assertionTokenType)) {
if (Strings.isNullOrEmpty(getAssertionToken()) && !containsMacro(ASSERTION_TOKEN)) {
String errMsg = ResourceConstants.ERR_MISSING_PARAM_PREFIX.getMsgForKey(ASSERTION_TOKEN);
Expand Down

0 comments on commit adfeef1

Please sign in to comment.