Skip to content

Commit 7020b8f

Browse files
committed
Merge remote-tracking branch 'origin/release/v11.1.6' into release/v11.1.6
2 parents 16bf9bb + 9f56d66 commit 7020b8f

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

backend/src/main/java/com/park/utmstack/security/saml/Saml2LoginSuccessHandler.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,11 @@ public void onAuthenticationSuccess(HttpServletRequest request,
5959

6060
Collection<? extends GrantedAuthority> authorities = Objects.requireNonNull(user.getAuthorities())
6161
.stream()
62-
.map(Objects::toString)
63-
.filter(r -> r.startsWith("ROLE_"))
64-
.map(SimpleGrantedAuthority::new)
62+
.map(a -> new SimpleGrantedAuthority(a.getName()))
6563
.toList();
6664

6765
UsernamePasswordAuthenticationToken auth =
68-
new UsernamePasswordAuthenticationToken((Object) username, null, authorities);
66+
new UsernamePasswordAuthenticationToken(username, null, authorities);
6967

7068
SecurityContextHolder.getContext().setAuthentication(auth);
7169

backend/src/main/java/com/park/utmstack/web/rest/UserJWTController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public ResponseEntity<LoginResponseDTO> authorize(@Valid @RequestBody LoginVM lo
8989
Authentication authentication = authenticationManager.authenticate(authenticationToken);
9090
SecurityContextHolder.getContext().setAuthentication(authentication);
9191

92-
String token = tokenProvider.createToken(authentication, false, isAuth);
92+
String token = tokenProvider.createToken(authentication, loginVM.isRememberMe(), isAuth);
9393

9494
User user = userService.getUserWithAuthoritiesByLogin(loginVM.getUsername())
9595
.orElseThrow(() -> new BadCredentialsException("Authentication failed: user '" + loginVM.getUsername() + "' not found"));

0 commit comments

Comments
 (0)