Skip to content

Commit a40c193

Browse files
fix(auth): make clientSecret optional for community mode
clientId is now the only required credential for features requiring auth. clientSecret remains optional for community/self-hosted deployments but is still validated server-side for enterprise mode. Part of OAuth2 migration - PR #948
1 parent 2df4c48 commit a40c193

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/main/java/com/getaxonflow/sdk/AxonFlow.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,12 +1675,12 @@ private void addAuthHeaders(Request.Builder builder) {
16751675
* Requires credentials for enterprise features.
16761676
*
16771677
* @param feature the feature name for error message
1678-
* @throws AuthenticationException if no credentials are configured
1678+
* @throws AuthenticationException if clientId is not configured
16791679
*/
16801680
private void requireCredentials(String feature) {
16811681
if (!config.hasCredentials()) {
16821682
throw new AuthenticationException(
1683-
feature + " requires credentials. Set clientId and clientSecret in config."
1683+
feature + " requires clientId. Set clientId in config (clientSecret is optional for community mode)."
16841684
);
16851685
}
16861686
}

src/main/java/com/getaxonflow/sdk/AxonFlowConfig.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ private void validate() {
8585
/**
8686
* Checks if credentials are configured.
8787
*
88-
* <p>Returns true if client credentials (clientId and clientSecret) are set.
88+
* <p>Returns true if clientId is set.
89+
* clientSecret is optional for community mode but required for enterprise.
8990
*
90-
* @return true if credentials are available
91+
* @return true if clientId is available
9192
*/
9293
public boolean hasCredentials() {
93-
return clientId != null && !clientId.isEmpty() &&
94-
clientSecret != null && !clientSecret.isEmpty();
94+
return clientId != null && !clientId.isEmpty();
9595
}
9696

9797
private String normalizeUrl(String url) {

0 commit comments

Comments
 (0)