Skip to content

Commit 12a3418

Browse files
committed
feat: show roles in log
1 parent cc18dd2 commit 12a3418

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/main/java/fr/insee/genesis/configuration/auth/security/OIDCSecurityConfig.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,18 @@ public Collection<GrantedAuthority> convert(Jwt source) {
144144
.toList();
145145

146146
// 🔹 4. Transforms in GrantedAuthority
147-
return Collections.unmodifiableCollection(
147+
List<GrantedAuthority> authorities =
148148
claimedRoles.stream()
149149
.map(s -> (GrantedAuthority) () -> ROLE_PREFIX + s)
150-
.toList()
151-
);
150+
.toList();
152151

152+
//TODO put on debug once genesis bug is corrected
153+
log.info("Authorities extracted from JWT: {}",
154+
authorities.stream()
155+
.map(GrantedAuthority::getAuthority)
156+
.toList());
157+
158+
return authorities;
153159
} catch (ClassCastException e) {
154160
// role path not correctly found, assume that no role for this user
155161
return List.of();

0 commit comments

Comments
 (0)