Class: SampleBasicAuth

Class: SampleBasicAuth

SampleBasicAuth

new SampleBasicAuth()

An example of protecting requests to the translation connector using Basic Auth.
NOTE: DO NOT USE THIS SAMPLE IN PRODUCTION.
Source:

Methods

validate(req, res, next)

Validate that incoming request against Basic Auth credentials. If validation fails, request is rejected.
NOTE: DO NOT USE THIS SAMPLE IN PRODUCTION.
Parameters:
Name Type Description
req object The HTTPS request object
res object The HTTPS response object
req.headers object Parameters passed on via the header.
Properties
Name Type Description
Authorization string Authorization header containing the un/pw
next function Callback function upon successful validation.
Source: