Class ApiKeyAuth
java.lang.Object
com.sap.cloud.sdk.services.openapi.apiclient.auth.ApiKeyAuth
- All Implemented Interfaces:
Authentication
Authentication at the REST API by providing an API key
-
Constructor Summary
ConstructorDescriptionApiKeyAuth
(String location, String paramName) Create an instance of this authentication using an API key -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyToParams
(org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.http.HttpHeaders headerParams) Apply authentication settings to header and / or query parameters.Get the API KeyGet the API key prefixGet the location of the API KeyGet the parameter name of the API Keyvoid
Set the API keyvoid
setApiKeyPrefix
(String apiKeyPrefix) Set the API key prefix
-
Constructor Details
-
ApiKeyAuth
Create an instance of this authentication using an API key- Parameters:
location
- The location of the API keyparamName
- The parameter name holding the API key
-
-
Method Details
-
getLocation
Get the location of the API Key- Returns:
- The location of the API key
-
getParamName
Get the parameter name of the API Key- Returns:
- The parameter name of the API key
-
getApiKey
Get the API Key- Returns:
- The API key
-
setApiKey
Set the API key- Parameters:
apiKey
- The API key
-
getApiKeyPrefix
Get the API key prefix- Returns:
- The API key prefix
-
setApiKeyPrefix
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 interfaceAuthentication
- Parameters:
queryParams
- The query parameters for the requestheaderParams
- The header parameters for the request
-