From 9b4287b811527871ff7fb1e550688f250086270a Mon Sep 17 00:00:00 2001
From: "Brian M. Long" <brian@inteligr8.com>
Date: Wed, 13 Mar 2024 10:35:01 -0400
Subject: [PATCH] only set OAuth client secret or password if set

---
 .../maven/aps/modeling/goal/ApsAddressibleGoal.java         | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/inteligr8/maven/aps/modeling/goal/ApsAddressibleGoal.java b/src/main/java/com/inteligr8/maven/aps/modeling/goal/ApsAddressibleGoal.java
index 1c47f06..d2f5a2c 100644
--- a/src/main/java/com/inteligr8/maven/aps/modeling/goal/ApsAddressibleGoal.java
+++ b/src/main/java/com/inteligr8/maven/aps/modeling/goal/ApsAddressibleGoal.java
@@ -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);