package Ġme . ely . component . security Ċ Ċ import Ġme . ely . component . security . jdbc . Login Failure Handler Ċ import Ġme . ely . component . security . jdbc . Login Success Handler Ċ import Ġorg . slf 4 j . LoggerFactory Ċ import Ġorg . springframework . context . annotation . Bean Ċ import Ġorg . springframework . context . annotation . Configuration Ċ import Ġorg . springframework . http . HttpMethod Ċ import Ġorg . springframework . security . config . annotation . authentication . builders . Authentication Manager Builder Ċ import Ġorg . springframework . security . config . annotation . method . configuration . Enable Global Method Security Ċ 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 . password . Password Encoder Ċ Ċ @ Configuration Ċ @ Enable Web Security ( debug Ġ= Ġfalse ) Ċ @ Enable Global Method Security ( pre Post Enabled Ġ= Ġtrue ) Ċ class ĠWeb Security Config Ġ: ĠWeb Security Configurer Adapter () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġlogger Ġ= ĠLoggerFactory . getLogger ( this . java Class ) ĊĊĠĠĠ Ġoverride Ġfun Ġconfigure ( http : ĠHttp Security ) Ġ{ ĊĠĠĠĠĠĠĠ Ġ// Ġ ç¦ģ çĶ¨ csrf ĊĠĠĠĠĠĠĠ Ġhttp . csrf (). disable () ĊĊĠĠĠĠĠĠĠ Ġhttp ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. authorize Requests () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. ant Matchers ( HttpMethod . OPTIONS , Ġ" /** "). permit All () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. ant Matchers (" /**/*. html "," /**/*. js "," /**/*. css ", Ġ" /**/*. ico "). permit All () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. ant Matchers ("/ api /** "). permit All () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. ant Matchers ("/ act uator /** "). permit All () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. ant Matchers ("/ v 2 / cons / gen "). permit All () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. ant Matchers ("/ v 2 / api - docs ", Ġ"/ swagger - resources ", Ġ"/ swagger - resources / configuration / ui ", Ġ"/ swagger - resources / configuration / security ", Ġ"/ swagger - ui . html ", Ġ"/ web j ars /** "). permit All () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. any Request (). authenticated () ĊĠĠĠĠĠĠĠ Ġ. and () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. form Login () Ġ// Ġé»ĺè®¤ çļĦ Ġsuccess Handler Ġæĺ¯ ĠSaved Request Aware Authentication Success Handler , Ġä¼ļ èĩªåĬ¨ éĩį å®ļ åĲĳ åĪ° ä¸Ĭ æ¬¡ è®¿éĹ® è¢« æĭ Ĵ çļĦ è¯·æ±Ĥ URL ĊĠĠĠĠĠĠĠĠĠĠĠĠ Ġ// Ġ. success Handler ( Login Success Handler ("/ ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. failure Handler ( Login Failure Handler ()) ĊĊĠĠĠĠĠĠĠ Ġ. and () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. exception Handling () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. access Denied Handler ( Simple Access Denied Handler ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġconfigure ( auth : ĠAuthentication Manager Builder ) Ġ{ ĊĠĠĠĠĠĠĠ Ġauth ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. in Memory Authentication () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. with User (" admin "). password ( password Encoder (). encode (" 1 1 1 1 ")). author ities (" USER _ MANAGER "). and () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. with User (" ely "). password ( password Encoder (). encode (" 1 1 1 1 ")). author ities (" NONE ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġpassword Encoder (): ĠPassword Encoder Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠMD 5 Password Encoder () Ġ// ĠBC rypt Password Encoder () ĊĠĠĠ Ġ} Ċ Ċ } Ċ