package Ġorg . fos dem . ste inh au er . demo . spring . config Ċ Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . context . annotation . Bean Ċ import Ġorg . springframework . context . annotation . Configuration Ċ import Ġorg . springframework . security . config . annotation . web . builders . Http Security Ċ import Ġorg . springframework . security . config . annotation . web . configuration . Enable Web Security Ċ import Ġorg . springframework . security . config . annotation . web . configuration . Web Security Configurer Adapter Ċ import Ġorg . springframework . security . core . user details . User Ċ import Ġorg . springframework . security . core . user details . UserDetails Service Ċ import Ġorg . springframework . security . provisioning . InMemory UserDetails Manager Ċ Ċ @ Configuration Ċ @ Enable Web Security Ċ class ĠF os dem Web Security Configurer Adapter Ġ@ Autowired Ġconstructor () Ġ: ĠWeb Security Configurer Adapter () Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġconfigure ( http : ĠHttp Security ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġhttp ?. authorize Requests () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ? . any Request ()?. authenticated () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ? . and ()?. http Basic () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġoverride Ġfun Ġuser Details Service (): ĠUser Details Service Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġuser Ġ= ĠUser . with Default Password Encoder () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. username (" fos dem ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. password (" F os dem . 2 0 2 1 !") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. roles (" USER "). build () ĊĊĠĠĠĠĠĠĠ Ġreturn ĠIn Memory UserDetails Manager ( user ) ĊĠĠĠ Ġ} Ċ }