File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
api/src/main/java/io/kafbat/ui/config/auth Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public class LdapProperties {
2020
2121 @ Value ("${oauth2.ldap.activeDirectory:false}" )
2222 private boolean isActiveDirectory ;
23- @ Value ("${oauth2.ldap.activeDirectory.domain:@ null}" )
23+ @ Value ("${oauth2.ldap.activeDirectory.domain:#{ null} }" )
2424 private String activeDirectoryDomain ;
2525
2626}
Original file line number Diff line number Diff line change 1212import java .util .stream .Stream ;
1313import lombok .RequiredArgsConstructor ;
1414import lombok .extern .slf4j .Slf4j ;
15+ import org .apache .commons .lang3 .StringUtils ;
1516import org .springframework .beans .factory .annotation .Autowired ;
1617import org .springframework .boot .autoconfigure .condition .ConditionalOnProperty ;
1718import org .springframework .boot .context .properties .EnableConfigurationProperties ;
@@ -163,6 +164,10 @@ public SecurityWebFilterChain configureLdap(ServerHttpSecurity http) {
163164 }
164165
165166 private ActiveDirectoryLdapAuthenticationProvider activeDirectoryProvider (LdapAuthoritiesPopulator populator ) {
167+ if (StringUtils .isBlank (props .getActiveDirectoryDomain ())) {
168+ throw new IllegalArgumentException ("Active Directory domain is required but not specified" );
169+ }
170+
166171 ActiveDirectoryLdapAuthenticationProvider provider = new ActiveDirectoryLdapAuthenticationProvider (
167172 props .getActiveDirectoryDomain (),
168173 props .getUrls ()
You can’t perform that action at this time.
0 commit comments