package Ġorg . v accine impact . order ly web . security . clients Ċ Ċ import Ġjava . net . URL Encoder Ċ import Ġorg . pac 4 j . core . client . Indirect Client Ċ import Ġorg . pac 4 j . core . context . Web Context Ċ import Ġorg . pac 4 j . core . credentials . Credentials Ċ import Ġorg . pac 4 j . core . credentials . auth enticator . Authenticator Ċ import Ġorg . pac 4 j . core . credentials . extractor . Credentials Extractor Ċ import Ġorg . pac 4 j . core . profile . Common Profile Ċ import Ġorg . pac 4 j . core . redirect . Redirect Action Ċ import Ġorg . pac 4 j . core . redirect . Redirect Action Builder Ċ import Ġorg . v accine impact . order ly web . db . AppConfig ĊĊ Ċ class ĠOrder ly Web Indirect Client () Ġ: ĠIn direct Client < Credentials , ĠCommon Profile > (){ ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġset Callback Url ("/ login ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġclient Init () ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ Ġdefault Credentials Extractor ( Never Inv oked Credentials Extractor ()) ĊĊĠĠĠĠĠĠĠ Ġdefault Redirect Action Builder ( Order ly Web Indirect Client Redirect Action Builder ()) ĊĊĠĠĠĠĠĠĠ Ġdefault Authenticator ( Never Inv oked Authenticator ()) ĊĠĠĠ Ġ} Ċ Ċ } Ċ Ċ class ĠOrder ly Web Indirect Client Redirect Action Builder : ĠRedirect Action Builder Ċ { ĊĠĠĠ Ġoverride Ġfun Ġredirect ( context : ĠWeb Context ) Ġ: ĠRedirect Action ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ Ġ// Attach Ġthe Ġoriginally Ġrequested Ġurl Ġto Ġthe Ġredirect Ġurl Ġas Ġa Ġquery Ġstring Ġparameter , Ġso Ġwe Ġcan Ġredirect ĊĠĠĠĠĠĠĠ Ġ// there Ġonce Ġauthenticated Ġvia Ġthe Ġ' landing Ġpage ' ĊĠĠĠĠĠĠĠ Ġval Ġrequested Url Ġ= Ġcontext . full Request URL ĊĠĠĠĠĠĠĠ Ġval Ġencoded Url Ġ= ĠURL Encoder . encode ( requested Url , Ġ" utf - 8 ") ĊĠĠĠĠĠĠĠ Ġreturn ĠRedirect Action . redirect ( AppConfig ()[" app . url "] Ġ+ Ġ"/ web login ? requested Url =" Ġ+ Ġencoded Url ) ĊĠĠĠ Ġ} Ċ } Ċ Ċ // The ĠOrder ly Indirect Client Ġis Ġonly Ġused Ġto Ġforward Ġthe Ġuser Ġon Ġto Ġthe Ġappropriate Ġauth Ġprovider Ġvia Ġthe Ġlanding Ġpage . Ċ // We Ġneed Ġto Ġprovide Ġa ĠCredentials Extractor Ġobject Ġto Ġkeep Ġpac 4 j Ġhappy , Ġbut Ġit Ġshould Ġnever Ġactually Ġbe Ġinvoked . Ċ // ĠSimilar ly Ġfor ĠNever Inv oked Authenticator Ċ class ĠNever Inv oked Credentials Extractor : ĠCredentials Extractor < Credentials > Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġextract ( context : ĠWeb Context ): ĠCredentials ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ Ġthrow ĠUnsupportedOperationException (" Never Inv oked Credentials Extractor Ġshould Ġnot Ġbe Ġinvoked .") ĊĠĠĠ Ġ} Ċ } Ċ Ċ class ĠNever Inv oked Authenticator : ĠAuth enticator < Credentials > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġvalidate ( credentials : ĠCredentials , Ġcontext : ĠWeb Context ) Ġ{ ĊĠĠĠĠĠĠĠ Ġthrow ĠUnsupportedOperationException (" Never Inv oked Authenticator Ġshould Ġnot Ġbe Ġinvoked .") ĊĠĠĠ Ġ} Ċ } ĊĊ