only set OAuth client secret or password if set

This commit is contained in:
Brian Long 2024-03-13 10:35:01 -04:00
parent 8d634670e1
commit 9b4287b811

View File

@ -117,7 +117,8 @@ public abstract class ApsAddressibleGoal extends DisablableGoal {
this.getLog().debug("OAuth Client ID: " + clientCreds.getUsername());
config.setOAuthClientId(clientCreds.getUsername());
config.setOAuthClientSecret(clientCreds.getPassword());
if (clientCreds.getPassword() != null && clientCreds.getPassword().length() > 0)
config.setOAuthClientSecret(clientCreds.getPassword());
}
if (oauthCreds != null) {
@ -126,7 +127,8 @@ public abstract class ApsAddressibleGoal extends DisablableGoal {
this.getLog().debug("OAuth Username: " + oauthCreds.getUsername());
config.setOAuthUsername(oauthCreds.getUsername());
config.setOAuthPassword(oauthCreds.getPassword());
if (oauthCreds.getPassword() != null && oauthCreds.getPassword().length() > 0)
config.setOAuthPassword(oauthCreds.getPassword());
}
config.setOAuthTokenUrl(this.oauthTokenUrl);