File tree 1 file changed +3
-3
lines changed
kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/audit
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 30
30
import org .springframework .beans .factory .annotation .Autowired ;
31
31
import org .springframework .security .core .GrantedAuthority ;
32
32
import org .springframework .security .core .context .SecurityContext ;
33
- import org .springframework .security .core .userdetails . UserDetails ;
33
+ import org .springframework .security .oauth2 . core .oidc . user . OidcUser ;
34
34
import org .springframework .stereotype .Service ;
35
35
import reactor .core .publisher .Mono ;
36
36
import reactor .core .publisher .Signal ;
@@ -197,10 +197,10 @@ private Mono<AuthenticatedUser> extractUser(Signal<?> sig) {
197
197
if (sig .getContextView ().hasKey (key )) {
198
198
return sig .getContextView ().<Mono <SecurityContext >>get (key )
199
199
.map (context -> context .getAuthentication ().getPrincipal ())
200
- .cast (UserDetails .class )
200
+ .cast (OidcUser .class )
201
201
.map (user -> {
202
202
var roles = user .getAuthorities ().stream ().map (GrantedAuthority ::getAuthority ).collect (Collectors .toSet ());
203
- return new AuthenticatedUser (user .getUsername (), roles );
203
+ return new AuthenticatedUser (user .getName (), roles );
204
204
})
205
205
.switchIfEmpty (NO_AUTH_USER );
206
206
} else {
You can’t perform that action at this time.
0 commit comments