package Ġcom . google . sh iny ay . controller Ċ Ċ import Ġcom . google . sh iny ay . logger Ċ import Ġorg . springframework . security . core . context . SecurityContext Holder Ċ import Ġorg . springframework . security . oauth 2 . jwt . Jwt Ċ import Ġorg . springframework . web . bind . annotation . GetMapping Ċ import Ġorg . springframework . web . bind . annotation . RestController Ċ import Ġjava . time . Zone Id Ċ import Ġjava . time . Z onedDateTime Ċ import Ġjava . time . format . DateTime Formatter Ċ Ċ @ RestController Ċ class ĠHello Controller Ġ{ ĊĊĠĠĠ Ġ@ GetMapping ("/") ĊĠĠĠ Ġfun Ġdefault Access (): ĠString Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdate And Time Ġ= ĠZ onedDateTime . now ( Zone Id . of (" J apan ")). format ( DateTime Formatter . of Pattern (" yyyy - MM - dd : ĠHH : mm : ss ")) ĊĠĠĠĠĠĠĠ Ġlogger . info ( date And Time ) ĊĠĠĠĠĠĠĠ Ġreturn Ġ" Hello Ġat Ġ$ date And Time " ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ GetMapping ("/ security ") ĊĠĠĠ Ġfun Ġsec ured Access (): ĠString Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġauthentication Ġ= ĠSecurity Context Holder . getContext (). authentication ĊĠĠĠĠĠĠĠ Ġval Ġjwt : ĠJwt Ġ= Ġauthentication . principal Ġas ĠJwt ĊĠĠĠĠĠĠĠ Ġreturn Ġ" [$ jwt . subject ]: [ ${ jwt . get Claim AsString (" email ") }] " ĊĠĠĠ Ġ} Ċ }