Object -
http
:
BasicAuthHandler
Defines the Basic Auth header handler for inbound and outbound HTTP traffic.
Constructor
__init
(InboundAuthProvider | OutboundAuthProvider authProvider)
- authProvider InboundAuthProvider | OutboundAuthProvider
-
The
auth:InboundAuthProviderinstance or theauth:OutboundAuthProviderinstance
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.
Fields
- authProvider InboundAuthProvider | OutboundAuthProvider
-
The AuthProvider instance
Checks if the provided request can be authenticated with the Basic Auth header.
Parameters
- req Request
-
The
http:Requestinstance
-
Return Type
(boolean) trueif authentication is successful or elsefalse
Authenticates the incoming request with the use of the credentials passed as the Basic Auth header.
Parameters
- req Request
-
The
http:Requestinstance
-
Return Type
(boolean | AuthenticationError) trueif it is possible to authenticate with Basic Auth,falseotherwise, or else anhttp:AuthenticationErrorin case of an error
Prepares the request with the Basic Auth header.
Parameters
- req Request
-
The
http:Requestinstance
-
Return Type
(Request | AuthenticationError) The updated
http:Requestinstance or else anhttp:AuthenticationErrorin case of an error
Inspects the request and response and calls the Auth provider for inspection.
-
Return Type
(Request | AuthenticationError | ()) The updated
http:Requestinstance or thehttp:AuthenticationErrorin case of an error or else()if nothing is to be returned