Class OAuth2Options.Builder
java.lang.Object
com.sap.cloud.sdk.cloudplatform.connectivity.OAuth2Options.Builder
- Enclosing class:
- OAuth2Options
A builder implementation that helps with creating customized
OAuth2Options
instances.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Creates a newOAuth2Options
instance.withClientKeyStore
(KeyStore clientKeyStore) Sets theKeyStore
to use for building an mTLS connection towards the target system.withSkipTokenRetrieval
(boolean skipTokenRetrieval) Indicates whether to skip the OAuth2 token flow.withTokenRetrievalParameter
(String key, String value) Adds (or overwrites) the provided key-value-pair to theOAuth2Options.getAdditionalTokenRetrievalParameters()
of the to-be-createdOAuth2Options
instance.withTokenRetrievalParameters
(Map<String, String> parameters) Adds (or overwrites) the provided parameters to theOAuth2Options.getAdditionalTokenRetrievalParameters()
of the to-be-createdOAuth2Options
instance.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
withSkipTokenRetrieval
Indicates whether to skip the OAuth2 token flow.- Parameters:
skipTokenRetrieval
-true
if the token retrieval should be skipped,false
otherwise.- Returns:
- This
OAuth2Options.Builder
.
-
withTokenRetrievalParameter
@Nonnull public OAuth2Options.Builder withTokenRetrievalParameter(@Nonnull String key, @Nonnull String value) Adds (or overwrites) the provided key-value-pair to theOAuth2Options.getAdditionalTokenRetrievalParameters()
of the to-be-createdOAuth2Options
instance.- Parameters:
key
- The parameter key.value
- The parameter value.- Returns:
- This
OAuth2Options.Builder
.
-
withTokenRetrievalParameters
@Nonnull public OAuth2Options.Builder withTokenRetrievalParameters(@Nonnull Map<String, String> parameters) Adds (or overwrites) the provided parameters to theOAuth2Options.getAdditionalTokenRetrievalParameters()
of the to-be-createdOAuth2Options
instance.- Parameters:
parameters
- The parameters to add.- Returns:
- This
OAuth2Options.Builder
.
-
withClientKeyStore
Sets theKeyStore
to use for building an mTLS connection towards the target system. ThisKeyStore
is not used to build an mTLS connection towards the OAuth2 token service.- Parameters:
clientKeyStore
- TheKeyStore
to use for building an mTLS connection towards the target system.- Returns:
- This
OAuth2Options.Builder
.
-
build
Creates a newOAuth2Options
instance.- Returns:
- A new
OAuth2Options
instance.
-