package Ġch . hell or in . chall eng ames . configuration Ċ Ċ import Ġch . hell or in . chall eng ames . service . user . UserService Ċ import Ġorg . springframework . context . annotation . Bean Ċ import Ġorg . springframework . context . annotation . Configuration Ċ import Ġorg . springframework . security . config . annotation . authentication . builders . Authentication Manager Builder Ċ 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 . crypto . bcrypt . BC rypt Password Encoder Ċ import Ġorg . springframework . security . crypto . password . Password Encoder Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . http . HttpMethod Ċ import Ġorg . springframework . security . authentication . dao . Dao Authentication Provider ĊĊ Ċ @ Configuration Ċ @ Enable Web Security Ċ class ĠSecurity Configuration Ġ: ĠWeb Security Configurer Adapter () Ġ{ ĊĠĠĠ Ġ@ Autowired ĊĠĠĠ Ġlateinit Ġvar Ġuser Details Service : ĠUserService ĊĊĠĠĠ Ġoverride Ġfun Ġconfigure ( auth : ĠAuthentication Manager Builder ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġauth !!. authentication Provider ( authentication Provider ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġauthentication Provider () Ġ: ĠDao Authentication Provider Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġauth Provider Ġ= ĠDao Authentication Provider () ĊĠĠĠĠĠĠĠ Ġauth Provider . setUser Details Service ( user Details Service ) ĊĠĠĠĠĠĠĠ Ġauth Provider . set Password Encoder ( get Encoder ()) ĊĠĠĠĠĠĠĠ Ġreturn Ġauth Provider ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġconfigure ( http : ĠHttp Security ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġhttp !!. authorize Requests () ĊĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. ant Matchers ( HttpMethod . GET , Ġ"/ challenges "). authenticated () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. ant Matchers ( HttpMethod . GET , Ġ"/ challenges /* "). authenticated () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. ant Matchers ( HttpMethod . PUT , Ġ"/ challenges / "). authenticated () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. ant Matchers ( HttpMethod . GET , Ġ"/ login /* "). authenticated () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. ant Matchers ( HttpMethod . GET , Ġ"/ user /** "). authenticated () ĊĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. ant Matchers ( HttpMethod . GET , Ġ"/ me /** "). authenticated () ĊĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. and (). http Basic () ĊĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. and (). csrf (). disable () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean (" password Encoder ") ĊĠĠĠ Ġfun Ġget Encoder (): ĠPassword Encoder Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠBC rypt Password Encoder () ĊĠĠĠ Ġ} Ċ }