Object -
http
:
BearerAuthHandler
Representation of the Bearer Auth header handler for both inbound and outbound HTTP traffic.
Constructor
__init
(InboundAuthProvider | OutboundAuthProvider authProvider)
- authProvider InboundAuthProvider | OutboundAuthProvider
Methods
Checks if the request can be authenticated with the Bearer Auth header.
Authenticates the incoming request with the use of credentials passed as the Bearer Auth header.
Prepares the request with the Bearer Auth header.
Inspects the request and response and calls the Auth provider for inspection.
Fields
- authProvider InboundAuthProvider | OutboundAuthProvider
-
The
InboundAuthProviderinstance or theOutboundAuthProviderinstance
Checks if the request can be authenticated with the Bearer Auth header.
Parameters
- req Request
-
The
Requestinstance
-
Return Type
(boolean) Returns
trueif can be authenticated. Else, returnsfalse
Authenticates the incoming request with the use of credentials passed as the Bearer Auth header.
Parameters
- req Request
-
The
Requestinstance
-
Return Type
(boolean | AuthenticationError) Returns
trueif authenticated successfully. Else, returnsfalseor theAuthenticationErrorin case of an error
Prepares the request with the Bearer Auth header.
Parameters
- req Request
-
The
Requestinstance
-
Return Type
(Request | AuthenticationError) Returns the updated
Requestinstance or theAuthenticationErrorin case of an error
Inspects the request and response and calls the Auth provider for inspection.
-
Return Type
(Request | AuthenticationError | ()) Returns the updated
Requestinstance, theAuthenticationErrorin case of an error, or()if nothing is to be returned