Skip to content

Conversation

surajbh123
Copy link
Contributor

@surajbh123 surajbh123 commented Apr 25, 2025

Scenario 1

 UserDetails user = User.builder()
                .username("user")
                .password(passwordEncoder.encode("user"))
// first adding authorities and then role
                .authorities("read", "item:view") 
// authorities getting overridden by role
                .roles("USER")
                .accountExpired(false)
                .accountLocked(false)
                .credentialsExpired(false)
                .disabled(false)
                .build();

authorities = ["ROLE_USER"]

Scenario 2

 UserDetails user = User.builder()
                .username("user")
                .password(passwordEncoder.encode("user"))
// first adding role and then authorities
                 .roles("USER")
// role getting overridden by authorities
                .authorities("read", "item:view") 
                .accountExpired(false)
                .accountLocked(false)
                .credentialsExpired(false)
                .disabled(false)
                .build();

authorities = ["read", "item:view"]

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 25, 2025
@surajbh123 surajbh123 force-pushed the roles-authority-issue branch from 71a1d96 to f1f547f Compare April 25, 2025 14:18
…tion manager

Signed-off-by: Suraj Bhadrike <[email protected]>

Signed-off-by: surajbh <[email protected]>
@surajbh123 surajbh123 force-pushed the roles-authority-issue branch from f1f547f to e1be0a0 Compare April 25, 2025 14:24
@surajbh123 surajbh123 changed the title Roles And Authority getting overridden and not available in authentication manager Roles and authorities are being overridden in GrantedAuthority and are not accessible within the AuthenticationManager. Apr 25, 2025
@surajbh123 surajbh123 closed this Apr 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants