* @return
* @throws LibraryException
*/
protected JsonReference createAuthenticatorRef(LibraryRequest request, Endpoint endpoint,
String logicalName) throws LibraryException {
JSReference authenticator = endpoint.getAuthenticator(logicalName, request.getToolkitJsUrl());
if (authenticator != null) {
try {
Map<String, Object> params = authenticator.getProperties();
Iterator<String> keys = params.keySet().iterator();
StringBuilder sb = new StringBuilder();
String paramName = getModuleParamName(authenticator.getModuleName());
sb.append("new ").append(paramName).append("({");
while(keys.hasNext()) {
String key = keys.next();
String value = (String)params.get(key);
sb.append(key).append(":").append(addMakeAbsoluteUrl(value).getRef());