The following script adds a REST Host with No Credentials
let arrAuthenticationParams:string[] = ["Per User Session", "", ""];
let objRESTAuthentication:RESTAuthentication = RESTAuthenticationManager.createAuthentication("Basic", arrAuthenticationParams);
let objRESTHost:RESTHost = new RESTHost("fqdn.cloudbuildtools.com - No Credentials");
objRESTHost.url = "https://fqdn.cloudbuildtools.com:443/";
objRESTHost.connectionTimeout = 30.0;
objRESTHost.operationTimeout = 60.0;
objRESTHost.authentication = objRESTAuthentication;
objRESTHost = RESTHostManager.addHost(objRESTHost);Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.

Hi Sean,
Firstly you need to visit http://www.htaccesstools.com/htpasswd-generator/ and enter your username and password and it will generate an encoded string which looks like the following: “admin:$apr1$7/sxCZRJ$obPoohOkLcFKunrKWR9dg.”, I used “admin” and “password”, you only need the 2nd part of the string i.e. the part after the “:”, see below for an example.
var strBasicAuthentication;
strBasicAuthentication = “$apr1$7/sxCZRJ$obPoohOkLcFKunrKWR9dg.”;
var objRESTRequest = objRESTOperation.createRequest([], null);
objRESTRequest.contentType = “application/json”;
objRESTRequest.setHeader(“Accept”,”application/json”);
objRESTRequest.setHeader(“Authorization”, “Basic ” + strBasicAuthentication);
Regards,
Simon Sparks