Class RedirectOutputService

java.lang.Object
swiss.trustbroker.homerealmdiscovery.service.RedirectOutputService

@Service public class RedirectOutputService extends Object
Output redirect in a form suitable for a calling script (XMLHttpRequest/fetch).
  • Constructor Details

    • RedirectOutputService

      public RedirectOutputService(org.apache.velocity.app.VelocityEngine velocityEngine, TrustBrokerProperties trustBrokerProperties)
  • Method Details

    • handleRedirect

      public String handleRedirect(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String redirectUrl)
      Absolute redirects are rendered via a page that auto-forwards to the link as they may be 3rd party / CORS without access granted to the calling script.
      Note: Caller must generate/validate redirectUrl to avoid open redirects.
      Returns:
      URL to redirect to or null if there's no redirect or the redirect was handled by this method .