Class XorCsrfTokenRequestAttributeHandler

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void handle​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.util.function.Supplier<CsrfToken> deferredCsrfToken)
      Handles a request using a CsrfToken.
      java.lang.String resolveCsrfTokenValue​(javax.servlet.http.HttpServletRequest request, CsrfToken csrfToken)
      Returns the token value resolved from the provided HttpServletRequest and CsrfToken or null if not available.
      void setSecureRandom​(java.security.SecureRandom secureRandom)
      Specifies the SecureRandom used to generate random bytes that are used to mask the value of the CsrfToken on each request.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XorCsrfTokenRequestAttributeHandler

        public XorCsrfTokenRequestAttributeHandler()
    • Method Detail

      • setSecureRandom

        public void setSecureRandom​(java.security.SecureRandom secureRandom)
        Specifies the SecureRandom used to generate random bytes that are used to mask the value of the CsrfToken on each request.
        Parameters:
        secureRandom - the SecureRandom to use to generate random bytes
      • resolveCsrfTokenValue

        public java.lang.String resolveCsrfTokenValue​(javax.servlet.http.HttpServletRequest request,
                                                      CsrfToken csrfToken)
        Description copied from interface: CsrfTokenRequestResolver
        Returns the token value resolved from the provided HttpServletRequest and CsrfToken or null if not available.
        Parameters:
        request - the HttpServletRequest being processed
        csrfToken - the CsrfToken created by the CsrfTokenRepository
        Returns:
        the token value resolved from the request