[io/http/server/utils/Request authenticator]
Authenticates request using the provided authentication method.
Keywords: authenticate, bearer token
Input ports
request:
{
"baseUrl": string,
"body": any,
"cookies": any,
"hostname": string,
"headers": {string: string},
"ip": string,
"ips": string[],
"method": ("GET" or "POST" or "PUT" or "PATCH" or "DELETE"),
"originalUrl": string,
"params": {string: string},
"path": string,
"protocol": ("http" or "https"),
"query": {string: any},
"route": string,
"secure": boolean,
"signedCookies": any,
"stale": boolean,
"subdomains": string[],
"xhr": boolean
}
Receives request to be authenticated
params: {optional "bearerToken": string}
Receives authentication parameters.
Output ports
request:
{
"baseUrl": string,
"body": any,
"cookies": any,
"hostname": string,
"headers": {string: string},
"ip": string,
"ips": string[],
"method": ("GET" or "POST" or "PUT" or "PATCH" or "DELETE"),
"originalUrl": string,
"params": {string: string},
"path": string,
"protocol": ("http" or "https"),
"query": {string: any},
"route": string,
"secure": boolean,
"signedCookies": any,
"stale": boolean,
"subdomains": string[],
"xhr": boolean
}
Sends request appended with authentication parameters.
error: {"error": "incorrect bearer token"}