Class BasicAuthenticationAccessor
java.lang.Object
com.sap.cloud.sdk.cloudplatform.security.BasicAuthenticationAccessor
Static accessor to retrieve the BasicCredentials of the currently incoming request.
-
Method Summary
Modifier and TypeMethodDescriptionstatic BasicAuthenticationFacadeThe actual implementation used to forward the business logic calls to.static voidOverrides the currently set facade with the given one, potentially changing the behavior of all following calls to theBasicAuthenticationAccessor.static io.vavr.control.Try<BasicCredentials>Getter to retrieve the basic credentials given by the currently incoming request.
-
Method Details
-
setBasicAuthenticationFacade
Overrides the currently set facade with the given one, potentially changing the behavior of all following calls to theBasicAuthenticationAccessor.In case the given facade is
nullthe default implementation will be reinstated.- Parameters:
facade- The facade to use for all future calls of theBasicAuthenticationAccessor. Ifnullis passed, theDefaultBasicAuthenticationFacadewill be used instead.
-
tryGetCurrentBasicCredentials
Getter to retrieve the basic credentials given by the currently incoming request.If the incoming request contains a basic authentication header the
Trywill contain this header as aBasicCredentialsobject. If the header was not given, was no basic authentication header or could not be decoded theTrywill contain the corresponding exception.- Returns:
- A
Trycontaining either theBasicCredentialsor an exception describing the error why the credentials could not be retrieved.
-
getBasicAuthenticationFacade
The actual implementation used to forward the business logic calls to.
-