protected RedirectAction build ( final CasClient casClient , final WebContext context , final boolean renew , final boolean gateway ) { val serviceUrl = casClient . computeFinalCallbackUrl ( context ) ; val casServerLoginUrl = casClient . getConfiguration ( ) . getLoginUrl ( ) ; val redirectionUrl = casServerLoginUrl + ( casServerLoginUrl . contains ( "?" ) ? "&" : "?" ) + CasProtocolConstants . PARAMETER_SERVICE + ' ' + EncodingUtils . urlEncode ( serviceUrl ) + ( renew ? ' ' + CasProtocolConstants . PARAMETER_RENEW + "=true" : StringUtils . EMPTY ) + ( gateway ? ' ' + CasProtocolConstants . PARAMETER_GATEWAY + "=true" : StringUtils . EMPTY ) ; LOGGER . debug ( "Final redirect url is [{}]" , redirectionUrl ) ; return RedirectAction . redirect ( redirectionUrl ) ; }
Build with predefined renew and gateway parameters .