Skip to main content
16-Pearl
May 31, 2021
Question

Change an organization Login Image with a service

  • May 31, 2021
  • 2 replies
  • 1700 views

I read very old threads telling it's not possible to do it

I also didn't find any possibility on thingworx 8.5

 

May this be possible by writing an extension ?

2 replies

15-Moonstone
June 1, 2021

@iguerra Please check the following information on the help center for creating/customizing login pages for your organization.

https://support.ptc.com/help/thingworx_hc/thingworx_8_hc/en/index.html#page/ThingWorx/Help/Composer/Security/Organizations/CreatingLoginPageFormsforOrganizations.html

 

iguerra16-PearlAuthor
16-Pearl
June 1, 2021

I know this, I can do it manually but not pragmatically (with a service)

My organization related entities are all created and configured pragmatically when a new organization is created.

Support
June 9, 2021

Hi @iguerra.

 

We're not finding a way to do this programmatically.  If interested, you can submit a request for this on the ThingWorx Ideas page.  This will allow other community members to vote for it.  You will need to provide details of your use case.

 

Regards.

 

--Sharon

iguerra16-PearlAuthor
16-Pearl
May 19, 2026

updated to thingworx 10.1 … still not possible to do … 
Posted new idea years ago … no plans to implement.

16-Pearl
May 27, 2026

I also did not find an official way. What you could try is mimic what the Composer does (needs applicationKey):

  1. (auth via AppKeyHeader)
  2. GET the entity https://<yourTWXHost>/Thingworx/Organizations/<orgName>
  3. Modify the response.loginImage =<base64encodedImage>
  4. PUT the entity back https://<yourTWXHost>/Thingworx/Organizations/<orgName>?reason=”Adapt%20Login%20Image” (in body put previous adapted response)

Make the requests with ContentLoaderFunctions.

I did not try that as of now - but when Composer can do it, you can do it as well via API (needs AppKey with correct permissions).

16-Pearl
May 27, 2026

I tested in TWX service and it works (with admin appkey):

const appkey = "05b9c02e-2fd1-44a6-8a14-b7567d1caed4";
const orgName = "MyOrg";
const host = "http://localhost:8080";
const URL = host + "/Thingworx/Organizations/" + orgName;

const HEADERS = {
"appKey": appkey,
"Accept": "application/json",
"Content-Type": "application/json"
};
// red 5x5 image
const WANTED_IMAGE = "/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAIBAQIBAQICAgICAgICAwUDAwMDAwYEBAMFBwYHBwcGBwcICQsJCAgKCAcHCg0KCgsMDAwMBwkODw0MDgsMDAz/2wBDAQICAgMDAwYDAwYMCAcIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAz/wAARCAAFAAUDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD5rooor8DP9oD/2Q==";

// Get Current org
let orgAsJson = Resources["ContentLoaderFunctions"].GetJSON({
headers: HEADERS,
url: URL,
});

// Update loginImage
orgAsJson.loginImage = WANTED_IMAGE;

// Save Org with new image
Resources["ContentLoaderFunctions"].PutJSON({
headers: HEADERS,
url: URL + "?reason=Update%20Login%20Image",
content: orgAsJson,
});

 

You will need to adapt appkey, orgName and host to your environment.

Note: As it’s not an official way this might break with some TWX update. I also did not really validate any sideffects - just if the image was set correctly.