Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Hello All,
How redirect Thingworx AMU application to form login page after logout?
Is there any OOTB solution for this?
I tried debugging the Mashup (PTC.FSU.COREUI.MenuConfiguration.Header_HD) and found out that there is no mashup given in logout function, so it is trying to redirect to index page and login popup comes from top(refer screenshot).
Solved! Go to Solution.
Hi Javed
Sorry for the delay. I had to reach to my team for a lot of help on this and test it. Also, keep in mind that this requires a lot of customization, which of course is allowed, however it cannot be officially supported by PTC. If you require more help on this, I will need to ask someone from the Delivery team to reach to you and see if a customization project can be done to better suit your needs.
---
Changing Mashups in AMU is not easy, because you can't just modify the existing Mashup. Here is my process for doing so, to reach the Logout button & be able to modify it :
- Duplicated Mashup PTC.FSU.COREUI.MenuConfiguration.Header_HD (note : the button is here)
- Duplicated Mashup PTC.FSU.COREUI.MenuConfiguration.MasterContainer_MU, change the contained Mashup to be PTC.FSU.COREUI.MenuConfiguration.Header_HD_Duplicate instead.
- Duplicated Mashup PTC.FSU.COREUI.MenuConfiguration.MasterContainer_EP, change the contained Mashup to be PTC.FSU.COREUI.MenuConfiguration.MasterContainer_MU_Duplicate instead.
- Duplicated Mashup PTC.FSU.COREUI.MenuConfiguration.MasterContainer_MS, change the contained Mashup to be PTC.FSU.COREUI.MenuConfiguration.MasterContainer_EP_Duplicate instead
- Insead of using URL http://SERVER_NAME_HERE:8080/Thingworx/Runtime/index.html?mashup=PTC.FSU.COREUI.MenuConfiguration.MasterContainer_EP to reach the main menu (the URL that's probably in your Favourites), use this one : http://SERVER_NAME_HERE:8080/Thingworx/Runtime/index.html?mashup=PTC.FSU.COREUI.MenuConfiguration.MasterContainer_EP_Duplicate
Now, about the Logout (and mostly, Login) behaviour : it's Organization-based. Users in Composers are separated in what we call Organization. By default, all users are part of the Everyone Organization, but you can define smaller ones. In the Organization's settings, there are multiple settings such as login prompt, image, etc. You can modify these to change what it looks like when this specific Organization's login window is reached. For more information on this, see https://support.ptc.com/help/thingworx/platform/r9.6/en/index.html#page/ThingWorx/Help/Composer/Security/Organizations/CreatingLoginPageFormsforOrganizations.html. While you're there, change the Organization's Home Mashup setting to http://SERVER_NAME_HERE:8080/Thingworx/Runtime/index.html?mashup=PTC.FSU.COREUI.MenuConfiguration.MasterContainer_EP_Duplicate so after logging back in, it will redirect users to this URL.
Now, how to modify the Logout button. It's in Mashup PTC.FSU.COREUI.MenuConfiguration.Header_HD_Duplicate. In the Design tab, it will be in the bottom-right section of the screen : it's a Function called Logout. I edited this Function to make it link to a URL, which looks like http://SERVER_NAME_HERE:8080/Thingworx/FormLogin/Everyone. Notice the name of the Organization (Everyone) must be written here. If you want specific Organizations to have different windows, you will need to add a service that returns the current user's Organization, and use that as part of the URL.
This will not affect the login popup that will appear when you first open the page, it will show the default Thingworx popup. There are other ways to reach login, my team gave me this as a possibility, however notice there are security warnings about doing this : https://www.ptc.com/en/support/article/CS227935.
Hi Javed
It's not just an AMU logout, it's an entire Thingworx logout. So even if you tried to redirect to another Mashup, you would get the same login popup. An example of this is : if you log out of AMU, you also get logged out of Composer.
Currently the Logout button just redirects to the main Thingworx Apps (AMU & others) menu. I believe this is because of the Mashup name given in the parameter in the URL, but I'm not familiar enough with this to confirm if/how this could be changed inside a Logout button. Normally the main Mashup can be found at http://SERVER_NAME_HERE:8080/Thingworx/Runtime/index.html?mashup=PTC.FSU.COREUI.MenuConfiguration.MasterContainer_EP, but I think if you just write another Mashup name in this URL then you will see that Mashup.
I am reaching to my colleagues who have more experience with custom login Mashups & options to see if something more could be done for this.
Hi @mstarnaud ,
You are correct on the above points.
If there would have been some configuration, to set either Mashup or URL to navigation once logout, it would have been better, as we do not want to show composer URL to end user.
Please do let me know if get any work around, as it's not that straight forward to change the existing mashups as they are non-editable.
Hi Javed
Sorry for the delay. I had to reach to my team for a lot of help on this and test it. Also, keep in mind that this requires a lot of customization, which of course is allowed, however it cannot be officially supported by PTC. If you require more help on this, I will need to ask someone from the Delivery team to reach to you and see if a customization project can be done to better suit your needs.
---
Changing Mashups in AMU is not easy, because you can't just modify the existing Mashup. Here is my process for doing so, to reach the Logout button & be able to modify it :
- Duplicated Mashup PTC.FSU.COREUI.MenuConfiguration.Header_HD (note : the button is here)
- Duplicated Mashup PTC.FSU.COREUI.MenuConfiguration.MasterContainer_MU, change the contained Mashup to be PTC.FSU.COREUI.MenuConfiguration.Header_HD_Duplicate instead.
- Duplicated Mashup PTC.FSU.COREUI.MenuConfiguration.MasterContainer_EP, change the contained Mashup to be PTC.FSU.COREUI.MenuConfiguration.MasterContainer_MU_Duplicate instead.
- Duplicated Mashup PTC.FSU.COREUI.MenuConfiguration.MasterContainer_MS, change the contained Mashup to be PTC.FSU.COREUI.MenuConfiguration.MasterContainer_EP_Duplicate instead
- Insead of using URL http://SERVER_NAME_HERE:8080/Thingworx/Runtime/index.html?mashup=PTC.FSU.COREUI.MenuConfiguration.MasterContainer_EP to reach the main menu (the URL that's probably in your Favourites), use this one : http://SERVER_NAME_HERE:8080/Thingworx/Runtime/index.html?mashup=PTC.FSU.COREUI.MenuConfiguration.MasterContainer_EP_Duplicate
Now, about the Logout (and mostly, Login) behaviour : it's Organization-based. Users in Composers are separated in what we call Organization. By default, all users are part of the Everyone Organization, but you can define smaller ones. In the Organization's settings, there are multiple settings such as login prompt, image, etc. You can modify these to change what it looks like when this specific Organization's login window is reached. For more information on this, see https://support.ptc.com/help/thingworx/platform/r9.6/en/index.html#page/ThingWorx/Help/Composer/Security/Organizations/CreatingLoginPageFormsforOrganizations.html. While you're there, change the Organization's Home Mashup setting to http://SERVER_NAME_HERE:8080/Thingworx/Runtime/index.html?mashup=PTC.FSU.COREUI.MenuConfiguration.MasterContainer_EP_Duplicate so after logging back in, it will redirect users to this URL.
Now, how to modify the Logout button. It's in Mashup PTC.FSU.COREUI.MenuConfiguration.Header_HD_Duplicate. In the Design tab, it will be in the bottom-right section of the screen : it's a Function called Logout. I edited this Function to make it link to a URL, which looks like http://SERVER_NAME_HERE:8080/Thingworx/FormLogin/Everyone. Notice the name of the Organization (Everyone) must be written here. If you want specific Organizations to have different windows, you will need to add a service that returns the current user's Organization, and use that as part of the URL.
This will not affect the login popup that will appear when you first open the page, it will show the default Thingworx popup. There are other ways to reach login, my team gave me this as a possibility, however notice there are security warnings about doing this : https://www.ptc.com/en/support/article/CS227935.