package Ġio . github . ka is ery . shi . micro service . common . config Ċ Ċ import Ġorg . springframework . context . annotation . Configuration Ċ import Ġorg . springframework . context . annotation . Profile Ċ import Ġorg . springframework . http . HttpMethod Ċ import Ġorg . springframework . security . config . annotation . web . builders . Http Security Ċ import Ġorg . springframework . security . oauth 2 . config . annotation . web . configuration . Enable Resource Server Ċ import Ġorg . springframework . security . oauth 2 . config . annotation . web . configuration . Resource Server Configurer Adapter Ċ import Ġorg . springframework . security . oauth 2 . config . annotation . web . configur ers . Resource Server Security Configurer Ċ import Ġorg . springframework . security . oauth 2 . provider . token . Token Store Ċ Ċ @ Configuration Ċ @ Enable Resource Server Ċ @ Profile (" micro service - oauth - client ") Ċ class ĠOAuth 2 Resource Server Config ( ĊĠ Ġval Ġtoken Store : ĠToken Store Ċ ) Ġ: ĠResource Server Configurer Adapter () Ġ{ ĊĊĠ Ġoverride Ġfun Ġconfigure ( resources : ĠResource Server Security Configurer ?) Ġ{ ĊĠĠĠ Ġresources !!. token Store ( token Store ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġconfigure ( http : ĠHttp Security ?) Ġ{ ĊĠĠĠ Ġhttp !! ĊĠĠĠĠĠ Ġ. authorize Requests () ĊĠĠĠĠĠ Ġ. ant Matchers ( HttpMethod . OPTIONS , Ġ" /** "). permit All () ĊĠĠĠĠĠ Ġ. ant Matchers ("/ api /** "). authenticated () ĊĠĠĠĠĠ Ġ. and () ĊĠĠĠĠĠ Ġ. http Basic (). disable () ĊĠĠĠĠĠ Ġ. headers (). frame Options (). disable () ĊĠ Ġ} Ċ } Ċ