Im new in Spring boot, and I got a task. I would like to give for example admin role from config for every user who visits the site. The users dont need to login.
Here is my idea: I get the anonymus user session and give the admin role to the session, but I dont know where and how to do that. Do you think its a working idea?
Here is my config:
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.anonymous()
.and()
.authorizeRequests()
.antMatchers("/**").permitAll()
.anyRequest()
.authenticated()
.and()
.httpBasic();
So its basically allow everyone to use every site but I would like to give them admin role as well. So where can I get the anonymus user's session and set the session role to admin if its a working ide?