package Ġch . j ta f . config čĊč Ċ import Ġch . j ta f . control . service . J ta f UserDetails Service č Ċ 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 . 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 . security . web . firewall . Default Http Firewall č Ċ import Ġorg . springframework . security . web . firewall . Http Firewall čĊč Ċ @ Configuration č Ċ @ Enable Web Security č Ċ class ĠWeb Security Config Ġ: ĠWeb Security Configurer Adapter () Ġ{ čĊčĊĠĠĠ Ġoverride Ġfun Ġconfigure ( http : ĠHttp Security ) Ġ{ čĊĠĠĠĠĠĠĠ Ġhttp čĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. authorize Requests () čĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. ant Matchers ("/ act uator / health "). permit All () čĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. ant Matchers ("/ act uator /** ", Ġ"/ sec /** "). authenticated () čĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. any Request (). permit All () čĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. and (). form Login (). login Page ("/ login "). permit All () čĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. and (). logout (). logout Url ("/ logout "). logout Success Url ("/ dashboard "). permit All () čĊĠĠĠ Ġ} čĊčĊĠĠĠ Ġ@ Autowired čĊĠĠĠ Ġfun Ġconfigure Global ( auth : ĠAuthentication Manager Builder , Ġj ta f UserDetails Service : ĠJ ta f UserDetails Service ) Ġ{ čĊĠĠĠĠĠĠĠ Ġauth . user Details Service ( j ta f UserDetails Service ). password Encoder ( password Encoder ()) čĊĠĠĠ Ġ} čĊčĊĠĠĠ Ġ@ Bean čĊĠĠĠ Ġfun Ġpassword Encoder (): ĠPassword Encoder Ġ{ čĊĠĠĠĠĠĠĠ Ġreturn ĠBC rypt Password Encoder () čĊĠĠĠ Ġ} čĊčĊĠĠĠ Ġ@ Bean čĊĠĠĠ Ġfun Ġallow Url Encoded Slash Http Firewall (): ĠHttp Firewall Ġ{ čĊĠĠĠĠĠĠĠ Ġreturn ĠDefault Http Firewall () čĊĠĠĠ Ġ} č Ċ } čĊčĊ