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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

How to Customizing the Log out Button in Windchill 10.2 ?

sghongade-3
10-Marble

How to Customizing the Log out Button in Windchill 10.2 ?

Hi folks,

Want to add log out functionality (Cutom Button) in Windchill 10.2?

11 REPLIES 11

It is not a custom button but you could add a favorites that has the following in the Web Document tab  URL: box under properties for the shortcut.  Then just have that in your favorites bar and select it when you want to logout.  It will ask you for a login again.  What I am showing you is for Internet Explorer.  I do not know if it works with other browsers.

javascript:document.execCommand("ClearAuthenticationCache", false) ;window.location.reload();

8-31-2016 8-27-11 AM.png

It works also with Firefox, but as written below.

javascript:window.location.href=window.location.href.replace(/:\/\//,"://dummy@");window.location.reload();

Marco

You have it already in WC 10.2, but by default it is disabled, you need to enable it to be visible.

Mohan,

How do you enable this?

It looks like log off capability is available for form-based authentication and is not available with the default basic authentication.

Anyway to enable the log off -

"xconfmanager -s wt.auth.form.enabled=true -t wt.properties -p"

"xconfmanager -s wt.logout.url=https://ptc.com-t wt.properties -p"

Hi Mohan Kumar

Thanks for sharing this info. I tried setting above 2 properties. Now I can see logout button; however, next time when I try login in, it do not prompt for authentication. It directly log in as previous user.

Any idea on this?

Thanks,

Shirish

Did the content of the logout.jsp file is replaced with the java script I pasted in my previous comment. When the logoff option is clicked it executes the java script which clears the user authentication followed by URL re- direct, if you try to go back to the page clicking back button in browser or try to access the windchill url from a new tab the authentication window will appear again.

 

Found a way to clear the basic authentication try this,

 

  1. Run this "xconfmanager -s wt.auth.form.enabled=true -t wt.properties -p".
  2. Replace the content in the JSP file “/wtcore/jsp/logout.jsp” to the below one (If you want to use your own JSP file , modify the fba-actions.xml to point to your jsp file)

  

<script language="javascript"> logout();
function logout(){
document.execCommand("ClearAuthenticationCache", false);
window.location = "http://google.com/"; // Put your re-direct URL here
}

     

  1. Restart Method Server.
  2. The logoff button appears on the quicklinks menu. Clicking the link will take your re-direct URL. On clicking the windchill again will bring the authentication window.

  

Can you think of any reason why the button would not show up after following your steps? my site.xconf properties: 

 

<Property name="wt.logout.url" overridable="true" targetFile="wt.properties"
value="http://google.com"/>
<Property name="wt.auth.form.enabled" overridable="true" targetFile="wt.properties"
value="true"/>

 

I removed all contents and pasted your code, then restarted windchill but no luck? 11.1 M010 CPS-01

 

Thanks 

 

-=Deepen

Ignore my last comment it was user error, don't copy paste code thinking it's 100% correct next time....

 

I get the button now but it doesn't clear out the session as expected nor does it go to the website defined in the jsp???

 

If I click back it goes to the last windchill page still logged in. I feel like even though it's looking at the jsp it's not executing the code. This button at the moment is as useful as a broken arm. 

 

Thanks 

 

-=D

hseelam
6-Contributor
(To:sghongade-3)

Hi Mohan,

When I try  ClearAuthenticationCache in logout.jsp,it is clearing the authentication cache for the remaining sessions in the browser which making them to prompt for login again.

This should not be the case when we implement this within the Windchill Application because we can add the ClearAuthenticationCache url in the browser itself. Could you tell me how to ClearAuthenticationCache for the Windchill session itself(not other sessions).

Announcements


Top Tags