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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates a newOAuth2Optionsinstance.withClientKeyStore(KeyStore clientKeyStore) Sets theKeyStoreto 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-createdOAuth2Optionsinstance.withTokenRetrievalParameters(Map<String, String> parameters) Adds (or overwrites) the provided parameters to theOAuth2Options.getAdditionalTokenRetrievalParameters()of the to-be-createdOAuth2Optionsinstance.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
withSkipTokenRetrieval
Indicates whether to skip the OAuth2 token flow.- Parameters:
skipTokenRetrieval-trueif the token retrieval should be skipped,falseotherwise.- 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-createdOAuth2Optionsinstance.- 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-createdOAuth2Optionsinstance.- Parameters:
parameters- The parameters to add.- Returns:
- This
OAuth2Options.Builder.
-
withClientKeyStore
Sets theKeyStoreto use for building an mTLS connection towards the target system. ThisKeyStoreis not used to build an mTLS connection towards the OAuth2 token service.- Parameters:
clientKeyStore- TheKeyStoreto use for building an mTLS connection towards the target system.- Returns:
- This
OAuth2Options.Builder.
-
build
Creates a newOAuth2Optionsinstance.- Returns:
- A new
OAuth2Optionsinstance.
-