Skip to content

Commit 00af933

Browse files
committed
Change login URL and fix basic auth
1 parent 10f0b8f commit 00af933

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

api/src/main/java/io/kafbat/ui/config/auth/BasicAuthSecurityConfig.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
@Slf4j
2323
public class BasicAuthSecurityConfig extends AbstractAuthSecurityConfig {
2424

25-
public static final String LOGOUT_URL = "/auth?logout";
25+
private static final String LOGIN_URL = "/login";
26+
private static final String LOGOUT_URL = "/auth?logout";
2627

2728
@Bean
2829
public SecurityWebFilterChain configure(ServerHttpSecurity http) {
@@ -40,6 +41,10 @@ public SecurityWebFilterChain configure(ServerHttpSecurity http) {
4041
.anyExchange()
4142
.authenticated()
4243
)
44+
.formLogin(form -> form
45+
.loginPage(LOGIN_URL)
46+
.authenticationSuccessHandler(authHandler)
47+
)
4348
.logout(spec -> spec
4449
.logoutSuccessHandler(logoutSuccessHandler)
4550
.requiresLogout(ServerWebExchangeMatchers.pathMatchers(HttpMethod.GET, "/logout")))

contract/src/main/resources/swagger/kafbat-ui-api.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2254,7 +2254,7 @@ paths:
22542254
schema:
22552255
$ref: '#/components/schemas/AppAuthenticationSettings'
22562256

2257-
/auth:
2257+
/login:
22582258
post:
22592259
summary: Authenticate
22602260
requestBody:

0 commit comments

Comments
 (0)