@@ -53,12 +53,11 @@ public Authentication authentication() {
53
53
.build ();
54
54
} else if (zeebeClientConfigurationProperties .getBroker ().getGatewayAddress () != null || zeebeSelfManagedProperties .getGatewayAddress () != null ) {
55
55
// figure out if Self-Managed JWT or Self-Managed Basic
56
- JwtConfig jwtConfig = configureJwtConfig ();
57
- IdentityConfig identityConfig = configureIdentities (jwtConfig );
58
-
59
56
// Operate Client props take first priority
60
57
if (operateClientConfigurationProperties != null ) {
61
58
if (hasText (operateClientConfigurationProperties .getKeycloakUrl ()) || hasText (operateClientConfigurationProperties .getKeycloakTokenUrl ())) {
59
+ JwtConfig jwtConfig = configureJwtConfig ();
60
+ IdentityConfig identityConfig = configureIdentities (jwtConfig );
62
61
return SelfManagedAuthentication .builder ()
63
62
.jwtConfig (jwtConfig )
64
63
.identityConfig (identityConfig )
@@ -77,6 +76,8 @@ public Authentication authentication() {
77
76
// Identity props take second priority
78
77
if (identityConfigurationFromProperties != null ) {
79
78
if (hasText (identityConfigurationFromProperties .getClientId ())) {
79
+ JwtConfig jwtConfig = configureJwtConfig ();
80
+ IdentityConfig identityConfig = configureIdentities (jwtConfig );
80
81
return SelfManagedAuthentication .builder ()
81
82
.jwtConfig (jwtConfig )
82
83
.identityConfig (identityConfig )
@@ -87,11 +88,15 @@ public Authentication authentication() {
87
88
// Fallback to common props
88
89
if (commonConfigurationProperties != null ) {
89
90
if (commonConfigurationProperties .getKeycloak ().getUrl () != null ) {
91
+ JwtConfig jwtConfig = configureJwtConfig ();
92
+ IdentityConfig identityConfig = configureIdentities (jwtConfig );
90
93
return SelfManagedAuthentication .builder ()
91
94
.jwtConfig (jwtConfig )
92
95
.identityConfig (identityConfig )
93
96
.build ();
94
97
} else if (commonConfigurationProperties .getKeycloak ().getTokenUrl () != null ) {
98
+ JwtConfig jwtConfig = configureJwtConfig ();
99
+ IdentityConfig identityConfig = configureIdentities (jwtConfig );
95
100
return SelfManagedAuthentication .builder ()
96
101
.jwtConfig (jwtConfig )
97
102
.identityConfig (identityConfig )
0 commit comments