The AuthProxy plugin provides the ability to make HTTPS requests with mutual
authentication.
The AuthProxy plugin allows you to specify a certificate to include in an HTTPS
request that identifies the client to the server, which allows the server to verify the
identity of the client. An example of where you might need mutual authenticaion is in
the onboarding process, when you register with an application, or, to access an OData
producer. You can make HTTPS requests with no authentication, with basic authentication,
or by using certificates. Supported certificate sources include file, system key
manager, and Afaria.
Sending Requests
There are two functions for sending requests:
- get = function (url, header, successCB, errorCB, user,
password, timeout, certSource). This is a convenience function and provides
no additional functionality compared to the sendRequest
function. It just calls the sendRequest function with the
method set to GET and no requestBody.
- sendRequest = function (method, url, header, requestBody,
successCB, errorCB, user, password, timeout, certSource).
Constructor Functions
There are three constructor functions to make objects that you can use for certificates:
- CertificateFromFile = function (Path, Password,
CertificateKey)
- CertificateFromLogonManager = function( AppID )
- CertificateFromStore = function (CertificateKey)
Note: The success callback is called upon any response from the
server, so be sure to check the status on the response.