Class: ClientBearerTokenAuthHandler
Defines the Bearer token auth handler for client authentication.
Constructor
Initializes the http:ClientBearerTokenAuthHandler
object.
init (BearerTokenConfig config)
- config BearerTokenConfig
The
http:BearerTokenConfig
instance
Methods
enrich | Enrich the request with the relevant authentication requirements. |
enrichHeaders | Enrich the headers map with the relevant authentication requirements. |
getSecurityHeaders | Returns the headers map with the relevant authentication requirements. |
enrich
function enrich(Request req) returns Request | ClientAuthError
Enrich the request with the relevant authentication requirements.
Parameters
- req Request
The http:Request
instance
Return Type
(Request | ClientAuthError)The updated http:Request
instance or else an http:ClientAuthError
in case of an error
enrichHeaders
function enrichHeaders(map<string | string[ ]> headers) returns map<string | string[ ]> | ClientAuthError
Enrich the headers map with the relevant authentication requirements.
Return Type
(map<string | string[ ]> | ClientAuthError)The updated headers map or else an http:ClientAuthError
in case of an error
getSecurityHeaders
function getSecurityHeaders() returns map<string | string[ ]> | ClientAuthError
Returns the headers map with the relevant authentication requirements.
Return Type
(map<string | string[ ]> | ClientAuthError)The updated headers map or else an http:ClientAuthError
in case of an error