Interface CsrfTokenRetriever

All Known Implementing Classes:
DefaultCsrfTokenRetriever

public interface CsrfTokenRetriever
Retrieves a CSRF token from a given remote system.
  • Field Details

  • Method Details

    • retrieveCsrfToken

      @Nonnull CsrfToken retrieveCsrfToken(@Nonnull org.apache.http.client.HttpClient httpClient, @Nonnull String servicePath)
      Retrieves an CSRF Token from a remote system by issuing an CSRF token request.
      Parameters:
      httpClient - The HttpClient to be used to issue the CSRF token request.
      servicePath - The service path (which would be appended to the destination URI) to be used to issue the CSRF token request.
      Returns:
      The fetched CsrfToken.
      Throws:
      CsrfTokenRetrievalException - When CSRF Token could not be fetched.
    • retrieveCsrfToken

      @Nonnull CsrfToken retrieveCsrfToken(@Nonnull org.apache.http.client.HttpClient httpClient, @Nonnull String servicePath, @Nonnull Map<String,Collection<String>> headers)
      Retrieves an CSRF Token from a remote system by issuing an CSRF token request.
      Parameters:
      httpClient - The HttpClient to be used to issue the CSRF token request.
      servicePath - The service path (which would be appended to the destination URI) to be used to issue the CSRF token request.
      headers - Additional headers to use for the CSRF token request.
      Returns:
      The fetched CsrfToken.
      Throws:
      CsrfTokenRetrievalException - When CSRF Token could not be fetched.
    • isEnabled

      default boolean isEnabled()
      Indicates if CSRF token retrieval is enabled.
      Returns:
      Flag indicating if CSRF token retrieval is enabled