Skip to content

Commit

Permalink
feat: remove global configureJwt as it interferes with simple mode
Browse files Browse the repository at this point in the history
  • Loading branch information
1nb0und committed Jan 24, 2024
1 parent bff459f commit 466c98d
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,11 @@ public Authentication authentication() {
.build();
} else if (zeebeClientConfigurationProperties.getBroker().getGatewayAddress() != null || zeebeSelfManagedProperties.getGatewayAddress() != null) {
// figure out if Self-Managed JWT or Self-Managed Basic
JwtConfig jwtConfig = configureJwtConfig();
IdentityConfig identityConfig = configureIdentities(jwtConfig);

// Operate Client props take first priority
if (operateClientConfigurationProperties != null) {
if (hasText(operateClientConfigurationProperties.getKeycloakUrl()) || hasText(operateClientConfigurationProperties.getKeycloakTokenUrl())) {
JwtConfig jwtConfig = configureJwtConfig();
IdentityConfig identityConfig = configureIdentities(jwtConfig);
return SelfManagedAuthentication.builder()
.jwtConfig(jwtConfig)
.identityConfig(identityConfig)
Expand All @@ -77,6 +76,8 @@ public Authentication authentication() {
// Identity props take second priority
if (identityConfigurationFromProperties != null) {
if (hasText(identityConfigurationFromProperties.getClientId())) {
JwtConfig jwtConfig = configureJwtConfig();
IdentityConfig identityConfig = configureIdentities(jwtConfig);
return SelfManagedAuthentication.builder()
.jwtConfig(jwtConfig)
.identityConfig(identityConfig)
Expand All @@ -87,11 +88,15 @@ public Authentication authentication() {
// Fallback to common props
if (commonConfigurationProperties != null) {
if (commonConfigurationProperties.getKeycloak().getUrl() != null) {
JwtConfig jwtConfig = configureJwtConfig();
IdentityConfig identityConfig = configureIdentities(jwtConfig);
return SelfManagedAuthentication.builder()
.jwtConfig(jwtConfig)
.identityConfig(identityConfig)
.build();
} else if (commonConfigurationProperties.getKeycloak().getTokenUrl() != null) {
JwtConfig jwtConfig = configureJwtConfig();
IdentityConfig identityConfig = configureIdentities(jwtConfig);
return SelfManagedAuthentication.builder()
.jwtConfig(jwtConfig)
.identityConfig(identityConfig)
Expand Down

0 comments on commit 466c98d

Please sign in to comment.