1 / 15

Windchill Logout

Windchill Logout. The next few slides show you the logout customization works for me in Internet Explorer 8 and Fire Fox 3.0 along with a few comments. Following those slides, is the documentation on how to configure it in your system for Windchill 9.1

egarney
Download Presentation

Windchill Logout

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Windchill Logout The next few slides show you the logout customization works for me in Internet Explorer 8 and Fire Fox 3.0 along with a few comments. Following those slides, is the documentation on how to configure it in your system for Windchill 9.1 Feel free to send me any comments and feedback to improve it. - David DeMay 02/15/2010 Contacts: david.a.demay@gmail.com weatherguru@comcast.net http://www.linkedin.com/in/daviddemay

  2. Windchill Logout Screenshots

  3. Windchill Logout Screenshots • Internet Explorer Directions: • Click ‘Logout’ link. • Change Username and Password in authentication dialog window. • Click ‘Ok’ button on the authentication dialog window. • When authentication dialog box comes back a second time click the cancel button. • A new page will display confirming logout of user. • On that new page click the “Log Back In As New User” link • Upon clicking link IE will use updated credentials from Step 2 above to authenticate and if valid, will display default Windchill page: i.e. http(s)://<hostname>/<webapp>

  4. Windchill Logout Screenshots NOTE:Fire Fox may handle this a bit differently, it still works though, but the authentication dialog may not behave exactly like Internet Explorer 8 as shown. i.e. you have to do a bit of reversal and click Cancel button first instead of entering your credentials. Believe it or not, Fire Fox operates to protocol. It’s Internet Explorer behaving backwards. This type of inconsistency might be one reason why it has not been implemented by PTC? However, for testers or even regular users. It’s not really a big deal once used to it like all other quirks in the system.

  5. Windchill Logout Screenshots You would only see this login splash screen again in Fire Fox or other browsers properly implemented to follow standard protocols. Internet Explorer will skip this screen because it uses new credentials provided before you clicked the cancel button on the authentication dialog when it appeared a second time.

  6. Windchill Logout Screenshots • Fire Fox Directions: • Click ‘Logout’ link. • Click ‘Cancel’ button on the authentication dialog window. • A new page will display confirming logout of user. • On that new page click the “Log Back In As New User” link • Upon clicking link Fire Fox will prompt for new credentials to authenticate and if valid, will display default Windchill page: i.e. http(s)://<hostname>/<webapp>

  7. Implementation of the Logout customization…

  8. Step 1.) Add logout servlet code to your codebase Copy the wclogout.jar file to <wt_home>/codebase/WEB-INF/lib/

  9. Step 2.) Configuring Tomcat Add the following to <wt_home>/codebase/WEB-INF/web.xml. I added them right at the end of the declaration of servlets and the beginning of the servlet mappings so these entries would appear together without messing up the existing XML structure. <servlet> <description>Provides a custom mechanism to force browser to simulate a logout by responding that valid credentials are invalid.</description> <servlet-name>WindchillLogout</servlet-name> <servlet-class>org.addons.servlets.logout.WindchillLogoutServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>WindchillLogout</servlet-name> <url-pattern>/servlet/WindchillLogout/*</url-pattern> </servlet-mapping>

  10. Step 3.) Configuring Apache In order for the servlet and browser to respond properly to a HTTP 401 not authorized error, the servlet must require authorization itself. To configure this in 9.1, add the following to <apache_home>/conf/extra/app-Windchill-Auth.conf. Note: Filename may be different based on name of Windchill install i.e. you don’t leave default name of Windchill during installation. <LocationMatch /Windchill/servlet/WindchillLogout(;.*)?> AuthzLDAPAuthoritative off AuthName "Windchill" AuthType Basic AuthBasicProvider Windchill-EnterpriseLdap Windchill-AdministrativeLdap require valid-user </LocationMatch> Again, location match may use something different then Windchill in the string if you changed it during installation. However, this is generally what it should look like. You’ll be able to look at this file and see the similarities to the OOTB servlet configurations in the same file.

  11. Step 4.) Add code to JSP to make Logout link appear in banner Note: This code will work in 9.1 – it may need to be tweaked to work in earlier Windchill versions, but it will work as we’re dealing with basic java servlet and HTTP technology that’s been around since the late 1990’s. I chose the file <wt_home>/codebase/netmarkets/jsp/util/begin_custom.jspf which is a JSP fragment file that cannot be executed as a standalone JSP file. It is included as a JSP include in 9.1 begin.jsp which renders the banner/header of Windchill pages. PTC recommeneds this as a place to put customizations such as this. If you have other content in this file, adding it to the very end would be okay. The jsp/javascript code for 9.1 appears below: <script type="text/javascript" language="JavaScript"> var wcLogoutURL = "<%=org.addons.ui.actions.WindchillLogoutAction.generateLink(request)%>"; function placeLogoutWindchillLinkInBanner() { var pageHeaderDiv = document.getElementById("pageHeader"); if (pageHeaderDiv != null) { var pageHeaderLinks = pageHeaderDiv.getElementsByTagName("A"); for (linkidx=0; linkidx < pageHeaderLinks.length; linkidx++) { var nameAttr = pageHeaderLinks[linkidx].getAttribute("name"); if (nameAttr != null && nameAttr.indexOf("copypagebutton") != -1) { var separator = document.createTextNode("|"); pageHeaderLinks[linkidx].parentNode.parentNode.appendChild(separator); var logoutLinkText = document.createTextNode("Logout"); var logoutLink = document.createElement("A"); logoutLink.setAttribute("href", wcLogoutURL); logoutLink.setAttribute("name", "logoutlinkbutton"); logoutLink.setAttribute("id", "logoutlinkbuttonid"); logoutLink.setAttribute("title", "Use this link to logout of Windchill as current user. Forces browser to prompt for authentication next time."); logoutLink.appendChild(logoutLinkText); logoutlinklistitem = document.createElement("LI"); logoutlinklistitem.appendChild(logoutLink); pageHeaderLinks[linkidx].parentNode.parentNode.appendChild(logoutlinklistitem); break; } } // end for } } Event.observe(window, 'load', placeLogoutWindchillLinkInBanner); </script>

  12. Step 5.) Clear Tomcat Cache and Restart All Servers Unless, you have Tomcat in development mode – where it will automatically recompile JSP files if the last modified timestamp on the file changes, you will need to clear your cache and restart Tomcat. It also will be a good idea to restart the MethodServer(s) just to play it safe. Apache will need to be restarted to pick up the new configuration changes so as to require authentication for the logout servlet.

  13. The HTTP Response

  14. On A Side Note Want to just have session timeout functionality? i.e. force the user to retype their password if a period of time goes by? This is possible also through what is known as a Tomcat filter. The session tracking cookie would be used as an identifier, but if a similar manner to the logout functionality just discussed, the filter could be used to send back a response of 401 not authorized making the user provide their password again. You would then have to work with tomcat session management API to update the session tacking cookie sent back to the user. On further thought, the Tomcat filter concept also may be useful to keep IE from trying to resubmit previous credentials if you click cancel the 1st on the authentication box (after clicking logout)

  15. Windchill Logout Hope you enjoyed this presentation! Please keep in mind that when you install this customization. You are doing so at your own risk and as a agent acting upon thereof with appropriate access to your Windchill system. This code and documentation are being distributed “as is” and NO support or warranty is guaranteed. This code and documentation shall be construed as if it was produced by yourself in house as a Windchill customization. Therefore myself, PTC, and any other third (3rd) party shall not be liable for any type of damages that arise from use of this software and documentation. While I may be willing to answer questions, my personal time is important. I will do my best to try and help out my other fellow Windchillers. I am always available as a Windchill programmer for hire on an hourly basis, but my time is limited outside my normal full time position. Feel free to send me any comments and feedback to improve this software. - David DeMay 02/15/2010 Contacts: david.a.demay@gmail.com weatherguru@comcast.net http://www.linkedin.com/in/daviddemay

More Related