Skip to content

Commit 38d047d

Browse files
committed
feat: remove global configureJwt as it interferes with simple mode
(cherry picked from commit 466c98d)
1 parent 6d4ca8f commit 38d047d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

spring-boot-starter-camunda/src/main/java/io/camunda/zeebe/spring/client/configuration/CommonClientConfiguration.java

+8-3
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,11 @@ public Authentication authentication() {
5353
.build();
5454
} else if (zeebeClientConfigurationProperties.getBroker().getGatewayAddress() != null || zeebeSelfManagedProperties.getGatewayAddress() != null) {
5555
// figure out if Self-Managed JWT or Self-Managed Basic
56-
JwtConfig jwtConfig = configureJwtConfig();
57-
IdentityConfig identityConfig = configureIdentities(jwtConfig);
58-
5956
// Operate Client props take first priority
6057
if (operateClientConfigurationProperties != null) {
6158
if (hasText(operateClientConfigurationProperties.getKeycloakUrl()) || hasText(operateClientConfigurationProperties.getKeycloakTokenUrl())) {
59+
JwtConfig jwtConfig = configureJwtConfig();
60+
IdentityConfig identityConfig = configureIdentities(jwtConfig);
6261
return SelfManagedAuthentication.builder()
6362
.jwtConfig(jwtConfig)
6463
.identityConfig(identityConfig)
@@ -77,6 +76,8 @@ public Authentication authentication() {
7776
// Identity props take second priority
7877
if (identityConfigurationFromProperties != null) {
7978
if (hasText(identityConfigurationFromProperties.getClientId())) {
79+
JwtConfig jwtConfig = configureJwtConfig();
80+
IdentityConfig identityConfig = configureIdentities(jwtConfig);
8081
return SelfManagedAuthentication.builder()
8182
.jwtConfig(jwtConfig)
8283
.identityConfig(identityConfig)
@@ -87,11 +88,15 @@ public Authentication authentication() {
8788
// Fallback to common props
8889
if (commonConfigurationProperties != null) {
8990
if (commonConfigurationProperties.getKeycloak().getUrl() != null) {
91+
JwtConfig jwtConfig = configureJwtConfig();
92+
IdentityConfig identityConfig = configureIdentities(jwtConfig);
9093
return SelfManagedAuthentication.builder()
9194
.jwtConfig(jwtConfig)
9295
.identityConfig(identityConfig)
9396
.build();
9497
} else if (commonConfigurationProperties.getKeycloak().getTokenUrl() != null) {
98+
JwtConfig jwtConfig = configureJwtConfig();
99+
IdentityConfig identityConfig = configureIdentities(jwtConfig);
95100
return SelfManagedAuthentication.builder()
96101
.jwtConfig(jwtConfig)
97102
.identityConfig(identityConfig)

0 commit comments

Comments
 (0)