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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Logging out and redirecting to an URL

CMabr
8-Gravel

Logging out and redirecting to an URL

My goal is simply to log the user out from ThingWorx and redirect to a custom URL. However I've ran in to several issues trying to achieve this.

 

Official "Logout button" widget:

The main issue is that there is no possibility to redirect to an URL, only to a mashup so this seems like a dead-end.

 

Customized "Logout button" widget by PTC Labs:

This widget logs out and redirects correctly as long as the url is external. When trying to redirect to a "/Thingworx/*" URL on the same domain the user is never logged out. 

 

Manual solution with REST call:

When making a REST call to "/Thingworx/Server/*/Services/" using the ThingworxInvoker the user is successfully logged out, but a basic authentication prompt is immediately displayed for the user. 

 

Is there a widget, or any way, to simply log the user out and redirect to a specified URL without a basic authentication prompt displaying in Thingworx? 

 

Thanks in advance.

4 REPLIES 4
slangley
23-Emerald II
(To:CMabr)

Hi @CMabr.

 

Please take a look at the following articles for potential solutions to your problem:

 

Logout Button functionality with redirect link/URL does not work in ThingWorx

How to Logout a user from a Mashup in ThingWorx

 

Regard.

 

--Sharon

 

If my response has answered your question, please mark it as the Accepted Solution, for the benefit of others who may have the same question.

CMabr
8-Gravel
(To:slangley)

Thanks for the reply. When using REST to invoke Logout or TerminateUserSessions I get a 200 OK response, but the session is still active and the user is not logged out.

 

If I invoke the same service(s) with the ThingworxInvoker it ends the session correctly, but a basic authentication form is immediately shown afterwards which I'm trying to avoid.

posipova
20-Turquoise
(To:CMabr)

On your third REST method, have you tried: http://<server>/Thingworx/Server/*/Services/Logout?method=post&_redirectURL=<URL>

(set the url, for example, to the form login page)

Otherwise, you may need to look into a custom authenticator. The topic has been discussed here before, please take a look to see if any help:

https://community.ptc.com/t5/ThingWorx-Developers/Redirect-login-to-FormLogin/m-p/506704

 

slangley
23-Emerald II
(To:posipova)

Hi @CMabr.

 

If one of the previous responses helped you to find a solution to your problem, please mark the appropriate one as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon

Announcements


Top Tags