java.lang.Object
com.sap.cloud.sdk.services.openapi.apiclient.auth.ApiKeyAuth
All Implemented Interfaces:
Authentication

public class ApiKeyAuth extends Object implements Authentication
Authentication at the REST API by providing an API key
  • Constructor Details

    • ApiKeyAuth

      public ApiKeyAuth(@Nonnull String location, @Nonnull String paramName)
      Create an instance of this authentication using an API key
      Parameters:
      location - The location of the API key
      paramName - The parameter name holding the API key
  • Method Details

    • getLocation

      @Nonnull public String getLocation()
      Get the location of the API Key
      Returns:
      The location of the API key
    • getParamName

      @Nonnull public String getParamName()
      Get the parameter name of the API Key
      Returns:
      The parameter name of the API key
    • getApiKey

      @Nonnull public String getApiKey()
      Get the API Key
      Returns:
      The API key
    • setApiKey

      public void setApiKey(@Nonnull String apiKey)
      Set the API key
      Parameters:
      apiKey - The API key
    • getApiKeyPrefix

      @Nonnull public String getApiKeyPrefix()
      Get the API key prefix
      Returns:
      The API key prefix
    • setApiKeyPrefix

      public void setApiKeyPrefix(@Nonnull String apiKeyPrefix)
      Set the API key prefix
      Parameters:
      apiKeyPrefix - The API key prefix
    • applyToParams

      public void applyToParams(@Nonnull org.springframework.util.MultiValueMap<String,String> queryParams, @Nonnull org.springframework.http.HttpHeaders headerParams)
      Description copied from interface: Authentication
      Apply authentication settings to header and / or query parameters.
      Specified by:
      applyToParams in interface Authentication
      Parameters:
      queryParams - The query parameters for the request
      headerParams - The header parameters for the request