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 BasicAuthenticationFacade
The actual implementation used to forward the business logic calls to.static void
Overrides 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
null
the default implementation will be reinstated.- Parameters:
facade
- The facade to use for all future calls of theBasicAuthenticationAccessor
. Ifnull
is passed, theDefaultBasicAuthenticationFacade
will 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
Try
will contain this header as aBasicCredentials
object. If the header was not given, was no basic authentication header or could not be decoded theTry
will contain the corresponding exception.- Returns:
- A
Try
containing either theBasicCredentials
or an exception describing the error why the credentials could not be retrieved.
-
getBasicAuthenticationFacade
The actual implementation used to forward the business logic calls to.
-