public final class BasicAuthenticationAccessor extends Object
Modifier and Type | Method and Description |
---|---|
static BasicAuthenticationFacade |
getBasicAuthenticationFacade()
The actual implementation used to forward the business logic calls to.
|
static void |
setBasicAuthenticationFacade(BasicAuthenticationFacade facade)
Overrides the currently set facade with the given one, potentially changing the behavior of all following calls
to the
BasicAuthenticationAccessor . |
static io.vavr.control.Try<BasicCredentials> |
tryGetCurrentBasicCredentials()
Getter to retrieve the basic credentials given by the currently incoming request.
|
public static void setBasicAuthenticationFacade(@Nullable BasicAuthenticationFacade facade)
BasicAuthenticationAccessor
.
In case the given facade is null
the default implementation will be reinstated.
facade
- The facade to use for all future calls of the BasicAuthenticationAccessor
. If null
is
passed, the DefaultBasicAuthenticationFacade
will be used instead.@Nonnull public static io.vavr.control.Try<BasicCredentials> tryGetCurrentBasicCredentials()
If the incoming request contains a basic authentication header the Try
will contain this header as a
BasicCredentials
object. If the header was not given, was no basic authentication header or could not be
decoded the Try
will contain the corresponding exception.
Try
containing either the BasicCredentials
or an exception describing the error why the
credentials could not be retrieved.@Nonnull public static BasicAuthenticationFacade getBasicAuthenticationFacade()
Copyright © 2021 SAP SE. All rights reserved.