Class DefaultCsrfTokenRetriever

java.lang.Object
com.sap.cloud.sdk.cloudplatform.connectivity.DefaultCsrfTokenRetriever
All Implemented Interfaces:
CsrfTokenRetriever

public class DefaultCsrfTokenRetriever extends Object implements CsrfTokenRetriever
Default implementation for retrieving a CSRF token from a given remote system.
  • Field Details

    • X_CSRF_TOKEN_HEADER_KEY

      public static final String X_CSRF_TOKEN_HEADER_KEY
      The HTTP header name for the loading the CSRF token.
      See Also:
  • Constructor Details

    • DefaultCsrfTokenRetriever

      public DefaultCsrfTokenRetriever()
  • Method Details

    • retrieveCsrfToken

      @Nonnull public CsrfToken retrieveCsrfToken(@Nonnull org.apache.http.client.HttpClient httpClient, @Nonnull String servicePath)
      Description copied from interface: CsrfTokenRetriever
      Retrieves an CSRF Token from a remote system by issuing an CSRF token request.
      Specified by:
      retrieveCsrfToken in interface CsrfTokenRetriever
      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.
    • retrieveCsrfToken

      @Nonnull public CsrfToken retrieveCsrfToken(@Nonnull org.apache.http.client.HttpClient httpClient, @Nonnull String servicePath, @Nonnull Map<String,Collection<String>> headers)
      Description copied from interface: CsrfTokenRetriever
      Retrieves an CSRF Token from a remote system by issuing an CSRF token request.
      Specified by:
      retrieveCsrfToken in interface CsrfTokenRetriever
      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.
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(@Nullable Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object