protected String constructLoginURL ( HttpServletRequest request , boolean isXMLRequest ) { String delimiter = "?" ; if ( authenticationProviderUrl . contains ( "?" ) ) { delimiter = "&" ; } StringBuilder loginURL = new StringBuilder ( ) ; if ( isXMLRequest ) { String atlasApplicationURL = "" ; String referalURL = request . getHeader ( "referer" ) ; if ( referalURL == null ) { atlasApplicationURL = request . getScheme ( ) + "://" + request . getServerName ( ) + ":" + request . getServerPort ( ) + request . getContextPath ( ) ; } else { atlasApplicationURL = referalURL ; } loginURL . append ( authenticationProviderUrl ) . append ( delimiter ) . append ( originalUrlQueryParam ) . append ( "=" ) . append ( atlasApplicationURL ) ; } else { loginURL . append ( authenticationProviderUrl ) . append ( delimiter ) . append ( originalUrlQueryParam ) . append ( "=" ) . append ( request . getRequestURL ( ) . append ( getOriginalQueryString ( request ) ) ) ; } return loginURL . toString ( ) ; }
Create the URL to be used for authentication of the user in the absence of a JWT token within the incoming request .