Trying to figure out if there's a way to do this without creating a custom plugin, but effectively I want to create a RestHost dynamically in the code, the call requires Basic Authentication so I'd like to store the credentials in a configuration element as an encrypted string. Unfortunately it does not appear possible as the RESTAuthenticationManager creates the authentication header using strings.
Create the restHost
var restHost = RESTHostManager.createHost("SomeName"); httpRestHost = RESTHostManager.createTransientHostFrom(restHost);
Apply Authentication
var authParams = ['Shared Session', user, password]; var authenticationObject = RESTAuthenticationManager.createAuthentication('Basic', authParams); httpRestHost.authentication = authenticationObject;
This works with valid user/password, however there seems to be no way to pass an encrypted string as the password instead.
Has anyone been able to achieve this?