Login Authorization Failed Error when executing ContentLoaderFunctions such as GetJSON or PostJSON
Hi,
I am running into authorization issues when trying to execute ContentLoaderFunctions such as GetJSON, or PostJSON. I have used debug logging and PostText statements to get more troubleshooting information. The Script Logs indicate the following error:
Login Authorization Failed
The server could not verify that you are authorized to access this document. The credentials you provided are either invalid (for example, you entered the wrong password) or your password has expired.
Alternately, your browser may be unable to provide the credentials that are required for authorization. Contact your organization’s administrator for more specific information about this error.
I can get everything to work for my account by adding my username and password to the parameters, but this is not a desirable solution in our production environment. Since the users are already authenticated via Windchill, is there a way to use that already established authentication for these types of services instead to hard coding username and password? Is this a permissions issue?
This very simple local Javascript service on an OData Connector with no input or output (other than logging) demonstrates the issue:
var CSRFToken;
var params = {
ignoreSSLErrors: false /* BOOLEAN */,
url: 'https://<Windchill Home>/servlet/odata/v2/PTC/GetCSRFToken()' /* STRING */,
timeout: 60000 /* NUMBER */
};
// result: Text
CSRFToken = Resources["ContentLoaderFunctions"].GetText(params);
logger.debug("CSRF Token = " + CSRFToken);
Any advice/guidance would be appreciated.
Thanks,
Roy

