Object -
http :
BasicAuthHandler
Defines the Basic Auth header handler for inbound and outbound HTTP traffic.
Constructor
__init
(InboundAuthProvider | OutboundAuthProvider authProvider)
- authProvider InboundAuthProvider | OutboundAuthProvider
Methods
Checks if the provided request can be authenticated with the Basic Auth header.
Authenticates the incoming request with the use of the credentials passed as the Basic Auth header.
Prepares the request with the Basic Auth header.
Inspects the request and response and calls the Auth provider for inspection.
req - The Request
instance.
resp - The Response
instance.
Fields
- authProvider InboundAuthProvider | OutboundAuthProvider
-
The AuthProvider instance.
Checks if the provided request can be authenticated with the Basic Auth header.
Parameters
- req Request
-
The request object.
-
Return Type
(boolean) Returns
true
if authentication is successful. Else, returnsfalse
.
Authenticates the incoming request with the use of the credentials passed as the Basic Auth header.
Parameters
- req Request
-
The request object.
-
Return Type
(boolean | AuthenticationError) Returns
true
if it is possible to authenticate with Basic Auth. Else, returnsfalse
or theAuthenticationError
in case of an error.
Prepares the request with the Basic Auth header.
Parameters
- req Request
-
The
Request
instance.
-
Return Type
(Request | AuthenticationError) Returns the updated
Request
instance or theAuthenticationError
in case of an error.
Inspects the request and response and calls the Auth provider for inspection.
req - The Request
instance.
resp - The Response
instance.
-
Return Type
(Request | AuthenticationError | ()) Returns the updated
Request
instance, theAuthenticationError
in case of an error, or()
if nothing is to be returned.