// Path: server/src/main/java/com/changeme/repository/UserProfile.java
// @Entity
// @Table(name = "user_profile")
// public class UserProfile {
// 
//     public static final PasswordEncoder PASSWORD_ENCODER = new BCryptPasswordEncoder();
// 
//     @Id
//     @Column(name = "id")
//     @GeneratedValue(strategy = GenerationType.IDENTITY)
//     private Long id;
//     @Column(name = "username")
//     private String username;
//     @JsonIgnore
//     @Column(name = "password")
//     private String password;
//     @Column(name = "authorities")
//     private String authorities;
// 
//     public UserProfile() {
//     }
// 
//     public UserProfile(String username, String password, String roles) {
//         this.setUsername(username);
//         this.setPassword(password);
//         this.setAuthorities(roles);
//     }
// 
//     public Long getId() {
//         return this.id;
//     }
// 
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     public String getUsername() {
//         return this.username;
//     }
// 
//     public void setUsername(String username) {
//         this.username = username;
//     }
// 
//     public String getPassword() {
//         return this.password;
//     }
// 
//     public void setPassword(String password) {
//         this.password = PASSWORD_ENCODER.encode(password);
//     }
// 
//     public String getAuthorities() {
//         return this.authorities;
//     }
// 
//     public void setAuthorities(String authorities) {
//         this.authorities = authorities;
//     }
// 
// 
// }


import com.changeme.repository.UserProfile;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.core.annotation.Order;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import javax.servlet.http.HttpServletResponse;
package com.changeme.security;



@Profile("development")
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
@Order(SecurityProperties.ACCESS_OVERRIDE_ORDER)
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {

    @Autowired
    private UserProfileDetailsService userProfileDetailsService;

    @Override
    public void configure(AuthenticationManagerBuilder auth) throws Exception {
// Path: server/src/main/java/com/changeme/repository/UserProfile.java
// @Entity
// @Table(name = "user_profile")
// public class UserProfile {
// 
//     public static final PasswordEncoder PASSWORD_ENCODER = new BCryptPasswordEncoder();
// 
//     @Id
//     @Column(name = "id")
//     @GeneratedValue(strategy = GenerationType.IDENTITY)
//     private Long id;
//     @Column(name = "username")
//     private String username;
//     @JsonIgnore
//     @Column(name = "password")
//     private String password;
//     @Column(name = "authorities")
//     private String authorities;
// 
//     public UserProfile() {
//     }
// 
//     public UserProfile(String username, String password, String roles) {
//         this.setUsername(username);
//         this.setPassword(password);
//         this.setAuthorities(roles);
//     }
// 
//     public Long getId() {
//         return this.id;
//     }
// 
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     public String getUsername() {
//         return this.username;
//     }
// 
//     public void setUsername(String username) {
//         this.username = username;
//     }
// 
//     public String getPassword() {
//         return this.password;
//     }
// 
//     public void setPassword(String password) {
//         this.password = PASSWORD_ENCODER.encode(password);
//     }
// 
//     public String getAuthorities() {
//         return this.authorities;
//     }
// 
//     public void setAuthorities(String authorities) {
//         this.authorities = authorities;
//     }
// 
// 
// }


// Path: server/src/main/java/com/changeme/security/SecurityConfiguration.java
import com.changeme.repository.UserProfile;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.core.annotation.Order;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import javax.servlet.http.HttpServletResponse;

package com.changeme.security;



@Profile("development")
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
@Order(SecurityProperties.ACCESS_OVERRIDE_ORDER)
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {

    @Autowired
    private UserProfileDetailsService userProfileDetailsService;

    @Override
    public void configure(AuthenticationManagerBuilder auth) throws Exception {
        auth.userDetailsService(userProfileDetailsService).passwordEncoder(UserProfile.PASSWORD_ENCODER);