Skip to content

Commit ca2e567

Browse files
Started adding OAuth2Login to reactive project
1 parent ee017ad commit ca2e567

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

spring-lemon-commons-reactive/src/main/java/com/naturalprogrammer/spring/lemon/commonsreactive/security/LemonCommonsReactiveSecurityConfig.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http)
3939

4040
formLogin(http); // Configure form login
4141
authorizeExchange(http); // configure authorization
42+
oauth2Login(http); // configure OAuth2 login
4243

4344
return http
4445
.securityContextRepository(NoOpServerSecurityContextRepository.getInstance())
@@ -54,6 +55,14 @@ public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http)
5455
.build();
5556
}
5657

58+
/**
59+
* Override this to configure oauth2 Login
60+
*/
61+
protected void oauth2Login(ServerHttpSecurity http) {
62+
63+
// Bypass here. OAuth2 login is needed only in the auth service
64+
}
65+
5766
/**
5867
* Override this to configure authorization
5968
*/

spring-lemon-reactive/src/main/java/com/naturalprogrammer/spring/lemonreactive/security/LemonReactiveSecurityConfig.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ protected String loginPage() {
5151
return "/api/core/login";
5252
}
5353

54+
/**
55+
* Configure OAuth2 login
56+
*/
57+
@Override
58+
protected void oauth2Login(ServerHttpSecurity http) {
59+
60+
http.oauth2Login(); // TODO: Configure properly
61+
}
5462

5563
@Override
5664
protected Mono<UserDto> fetchUserDto(JWTClaimsSet claims) {

0 commit comments

Comments
 (0)