Object - http : BearerAuthHandler

Representation of the Bearer Auth header handler for both inbound and outbound HTTP traffic.

Constructor

__init

(InboundAuthProvider | OutboundAuthProvider authProvider)

Methods

Fields

canProcess

(Request req)

returns boolean

Checks if the request can be authenticated with the Bearer Auth header.

Parameters

  • Return Type

    (boolean)
  • Returns true if can be authenticated. Else, returns false

process

(Request req)

returns boolean | AuthenticationError

Authenticates the incoming request with the use of credentials passed as the Bearer Auth header.

Parameters

  • Return Type

    (boolean | AuthenticationError)
  • Returns true if authenticated successfully. Else, returns false or the AuthenticationError in case of an error

prepare

(Request req)

returns Request | AuthenticationError

Prepares the request with the Bearer Auth header.

Parameters

inspect

(Request req, Response resp)

returns Request | AuthenticationError | ()

Inspects the request and response and calls the Auth provider for inspection.

Parameters

  • Return Type

    (Request | AuthenticationError | ())
  • Returns the updated Request instance, the AuthenticationError in case of an error, or () if nothing is to be returned