/* Ċ Ġ* Ġspring - message - board - demo Ċ Ġ* ĠRefer Ġto ĠLIC ENCE . txt Ġfor Ġlicence Ġdetails . Ċ Ġ*/ Ċ package Ġcom . github . fj . board . component . auth . impl Ċ Ċ import Ġcom . github . fj . board . component . auth . Controller Client Auth Info Detector Ċ import Ġcom . github . fj . board . vo . auth . Client Auth Info Ċ import Ġorg . springframework . security . core . context . SecurityContext Holder Ċ import Ġorg . springframework . stereotype . Component Ċ import Ġorg . springframework . web . context . request . RequestContext Holder Ċ import Ġorg . springframework . web . context . request . Servlet Request Attributes Ċ Ċ /** Ċ Ġ* Ġ@ author ĠFr ances co ĠJo ( nim bus ob @ gmail . com ) Ċ Ġ* Ġ@ since Ġ 2 2 Ġ- ĠJul Ġ- Ġ 2 0 2 0 Ċ Ġ*/ Ċ @ Component Ċ internal Ġclass ĠController Client Auth Info Detector Impl Ġ: ĠController Client Auth Info Detector Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġdetect Client Auth Info (): ĠClient Auth Info ? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġmaybe Authentication Ġ= ĠSecurity Context Holder . getContext ()?. authentication ĊĠĠĠĠĠĠĠ Ġval Ġmaybe Auth Object Ġ= Ġmaybe Authentication Ġas ? ĠAuthentication Object Impl ĊĊĠĠĠĠĠĠĠ Ġval Ġmaybe Servlet Req Attrs Ġ= ĠRequest Context Holder . getRequest Attributes () Ġas ? ĠServlet Request Attributes ĊĠĠĠĠĠĠĠ Ġval Ġmaybe Http Req Ġ= Ġmaybe Servlet Req Attrs ?. request ĊĊĠĠĠĠĠĠĠ Ġreturn Ġif Ġ( maybe Http Req Ġ== Ġnull Ġ|| Ġmaybe Auth Object Ġ== Ġnull ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnull ĊĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠClient Auth Info . create ( maybe Auth Object . name , Ġmaybe Http Req ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ