Answers for "update role spring security"

0

update role spring security

Set<GrantedAuthority> authorities = new HashSet<>();
authorities.add(new SimpleGrantedAuthority("USER"));
authorities.add(new SimpleGrantedAuthority("ADMIN"));

Authentication reAuth = new UsernamePasswordAuthenticationToken("user",new 

BCryptPasswordEncoder().encode("password"),authorities);  

SecurityContextHolder.getContext().setAuthentication(reAuth);
Posted by: Guest on November-03-2020

Code answers related to "update role spring security"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language