Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

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);
Comment

PREVIOUS NEXT
Code Example
Java :: code to get date and time in android 
Java :: android get id of view 
Java :: get my jre path 
Java :: x = x + y; in java 
Java :: java icon to image 
Java :: get sum of int array and return string 
Java :: quit button java swing 
Java :: what are the chances that i pass this coming up test 
Java :: ticket sales java program 
Java :: why does the ribbon dependency crush my app 
Java :: nitrite get repo structure 
Sql :: how to get the size of the database in postgresql 
Sql :: oracle nls_date_format 
Sql :: oracle see column type 
Sql :: oracle create directory 
Sql :: mysql where column not integer 
Sql :: oracle get current schema 
Sql :: postgresql blocked on mac 
Sql :: starts and end with vowel sql 
Sql :: sqlite alter table add column 
Sql :: show list of users in mysql 
Sql :: mysql add column if not exists 
Sql :: autoincrement sqlite command 
Sql :: alter table delete column 
Sql :: update with inner join 
Sql :: sql between date range 
Sql :: postgres DROP and create contraint 
Sql :: postgres read table structure 
Sql :: mysql monthname 
Sql :: mysql created at yesterdau 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =