cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

custom URL

pwareham
1-Visitor

custom URL

I created a very simple “weather dashboard” and its working ok when previewing with Composer.

I was wondering how I can set a custom URL to view it as a user?

When I use server.com/ThingWorx/Mashups/mashup it just shows a blank page.  So I suppose by question is two part:

1. How can I access a mashup URL outside of Composer view?

2. Can that URL be customized?

thanks!

ACCEPTED SOLUTION

Accepted Solutions
Aanjan
12-Amethyst
(To:pwareham)

Paul, to access Mashups outside of Composer, you can do it two different ways - copy the entire URL when you view the Mashup through the Composer and use that which would look similar to this - localhost/Thingworx/Runtime/index.html#mashup=Mashup_name

Or you can make a REST call similar to this - localhost/Thingworx/Mashups/Mashup_name?appKey=Your_appKey&x-thingworx-session=true

In the first scenario, you would get a pop up asking for a username/ password to authenticate. In the second one, with the provided appKey, it would log you straight into the Mashup.

Regarding customizing the URL, we don't have that functionality in ThingWorx. You would need to use an external application or any proxy of sorts.

View solution in original post

10 REPLIES 10
Aanjan
12-Amethyst
(To:pwareham)

Paul, to access Mashups outside of Composer, you can do it two different ways - copy the entire URL when you view the Mashup through the Composer and use that which would look similar to this - localhost/Thingworx/Runtime/index.html#mashup=Mashup_name

Or you can make a REST call similar to this - localhost/Thingworx/Mashups/Mashup_name?appKey=Your_appKey&x-thingworx-session=true

In the first scenario, you would get a pop up asking for a username/ password to authenticate. In the second one, with the provided appKey, it would log you straight into the Mashup.

Regarding customizing the URL, we don't have that functionality in ThingWorx. You would need to use an external application or any proxy of sorts.

pwareham
1-Visitor
(To:Aanjan)

Hi Aanjan -

Thanks for the information.

Can you suggest any examples of external applications, or types of proxy servers that could accomplish the remapping of URLs?

Thanks,

Paul

Aanjan
12-Amethyst
(To:pwareham)

There's a wide number of URL shorteners like Bitly and TinyCC. I would personally recommend using proxies instead, as you would get control over what can be done. Nginx is popular proxy server, and you can setup a reverse proxy back to your Platform. With that set, you can read any incoming connections to, say test.com, and forward them onto your platform_ip/Thingworx/Composer or specific Mashups if needed. It would mainly depend on your use case and the volume of Mashups you might have.

pwareham
1-Visitor
(To:Aanjan)

Thanks.

When an end user views a mashup using the entire URL through the Composer, I am getting the little toolbar at the top that allows you to change the resolution manually, etc.  That toolbar is not really appropriate for the end user, so does that imply the REST method would be more suitable?  If so, is it really a good idea, security wise, to include the app key in the URLs?

Aanjan
12-Amethyst
(To:pwareham)

That would be because of the "&__fromBuilder=xxxxxxxx" you have on the URL. If you remove them, you shouldn't be seeing the extra options. Exposing the appKey is not a good idea, as it can be used in a number of ways.

The best method would be to use FormLogins. What you can do is create an Organization, add users or usergroups to that Organization, and set a Home Mashup for the entire Organization or to specific Users. So, all you would need is this - ip/Thingworx/FormLogin/Name_of_Org. That would take them to a custom page, where a user would be able to login with their credentials. Once logged in, it would take them directly to the set Home Mashup.

pwareham
1-Visitor
(To:Aanjan)

ah ok.

So if we wanted to completely hide from the end user  the /ThingWorx in the URL the only way would be to use a reverse proxy correct?

Aanjan
12-Amethyst
(To:pwareham)

Yes, with a reverse proxy server, you can completely mask the URL where it is connecting to.

qngo
12-Amethyst
(To:Aanjan)

According to this post, is it nearly impossible to completly hide the "/Thingworx" ?

How to set up a reverse proxy with organization structure?

atahri
4-Participant
(To:Aanjan)

I followed exactly these steps, however the mashup is not displayed. I am wondering about the app key is there a specific configuration to how to define it?  Is there a visibility permission that need to be done in this case ? 

 

keriw
12-Amethyst
(To:pwareham)

You could provide a customization by passing a parameter along with the mashup and doing some logic based on a passed in mashupParameter, if mashupParameterA = 1 then have functionality based on 1 that turns the screen blue, if 2 then have it turn orange, etc.

Announcements


Top Tags