How to open a Webview or TeamCenter URL without the login page?

Document ID : KB000022664
Last Modified Date : 16/10/2018
Show Technical Document Details
Question:

How can I open a Webview or a TeamCenter url or page without having to stop at the authentication screen to manually enter credentials? 

Answer:
You can suppress the login page by using the option j_security_check?j_username=<YourUser>&j_password=<YourUserPassword>
 
The below are only a few examples to illustrate this capability, you can use any valid and available URL from Webview or TeamCenter UIs
Adjust the webview port number accordingly to your environment.
 
If you are using APM versions : 9.6, 9.7, 10.0.x, 10.1.x, 10.2.x, 10.3.x:
 
Option a) Open a Webview page directly using a simple URL (valid for Webview only)

Example 1 : Open the home tab:
http://<webview-hostname>:8080/j_security_check?j_username=<YourUserName>&j_password=<YourUserPassword>
 
Example 2 : Open the Console tab:
http://<webview-hostname>:8080/j_security_check?j_username=<YourUserName>&j_password=<YourUserPassword>#console
 
Example 3: Open a specific dashboard
http://<webview-hostname>:8080/j_security_check?j_username=<YourUserName>&j_password=<YourUserPassword>#console;db=EM+Capacity;dn=SuperDomain;mm=Supportability
 
Example 4:Open a specific node in the Metric Browser: SuperDomain | Custom Metric Host (Virtual) | Custom Metric Proces (Virtual) | Custom Metric Agent (Virtual)
http://<webview-hostname>:8080/j_security_check?j_username=<YourUserName>&j_password=<YourUserPassword>#investigator;smm=false;tab-in=mb;tab-tv=pd;tr=0;uid=SuperDomain%257CCustom+Metric+Host+(Virtual)%257CCustom+Metric+Process+(Virtual)%257CCustom+Metric+Agent+(Virtual)%257CEnterprise+Manager
 
Example 5:-Open a specific metric in the Metric Browser:  Custom Metric Agent (Virtual) | Enterprise Manager | Overall Capacity (%)
http://<webview-hostname>:8080/j_security_check?j_username=<YourUserName>&j_password=<YourUserPassword>#investigator;smm=false;tab-in=mb;tab-tv=pd;tr=0;uid=SuperDomain%257CCustom+Metric+Host+(Virtual)%257CCustom+Metric+Process+(Virtual)%257CCustom+Metric+Agent+(Virtual)%257CEnterprise+Manager%253AOverall+Capacity+(%2525)
 
Example 6:-Open the Tools \ Transaction Tracer tab:
http://<webview-hostname>:8080/j_security_check?j_username=<YourUserName>&j_password=<YourUserPassword>#tools;tab-to=tt
 
Example 7:-Open the Tools \ Historical Event Viewer tab:
http://<webview-hostname>:8080/j_security_check?j_username=<YourUserName>&j_password=<YourUserPassword>#tools;tab-to=he
 
Example 8:-Open the Tools \ Live Error Viewer tab:
http://<webview-hostname>:8080/j_security_check?j_username=<YourUserName>&j_password=<YourUserPassword>#tools;tab-to=er
 
Example 9:-Open the Management tab:
http://<webview-hostname>:8080/j_security_check?j_username=<YourUserName>&j_password=<YourUserPassword>#management
 

Option b) Open a Webview and TeamCenter page by embedding the webview/teamcenter page into an iFrame section
 
Example 10: Open a specific dashboard in Webview:
 
<meta HTTP-EQUIV="REFRESH" content="2; url=http://<webview-hostname>:8080/#console;db=EM+Capacity;dn=SuperDomain;mm=Supportability">
<html>
<body>
<iframe src ="http://<webview-hostname>:8080/j_security_check?j_username=<YourUserName>&j_password=<YourUserPassword>" width="0%"></iframe>
</body>
</html>
 
Example 11: Open TeamCenter \ dashboard:
 
<meta HTTP-EQUIV="REFRESH" content="2; url=http://<webview-hostname>:8080/ApmServer/#/dashboard?fa=%5B%5D&ep=1&g=PE1&m=L&cht=0&chs=1&cha=0&u=">
<html>
<body>
<iframe src ="http://<webview-hostname>:8080/j_security_check?j_username=<YourUserName>&j_password=<YourUserPassword>" width="0%"></iframe>
</body>
</html>
 
Example 12: Open TeamCenter \ map:
 
<meta HTTP-EQUIV="REFRESH" content="2; url=http://<webview-hostname>:8080/ApmServer/#/map?fa=%5B%5D&ep=1&g=PE1&m=L&cht=0&chs=1&cha=0&u=">
<html>
<body>
<iframe src ="http://<webview-hostname>:8080/j_security_check?j_username=<YourUserName>&j_password=<YourUserPassword>" width="0%"></iframe>
</body>
</html>
 
Example 13: Open TeamCenter \ Settings \ Universes tab:
 
<meta HTTP-EQUIV="REFRESH" content="2; url=http://<webview-hostname>:8080/ApmServer/#/universes?fa=%5B%5D&ep=1&g=PE1&m=L&cht=0&chs=1&cha=0&u=">
<html>
<body>
<iframe src ="http://<webview-hostname>:8080/j_security_check?j_username=<YourUserName>&j_password=<YourUserPassword>" width="0%"></iframe>
</body>
</html>
 

If you are using APM versions: 10.5.x, 10.7.x:
 
Opening a Webview page directly using a URL is no longer possible, the GET operation has been disabled to prevent the Cross Site scripting Vulnerability security issue. Starting from 10.5, you need to use a HTTP POST on the http://<webview-hostname>:8080/j_security_check, where username and password are passed in body (Content-Type: application/x-www-form-urlencoded) :
- Body: "j_username=" + username + "&j_password=<YourUserPassword>" + password, headers
- You have to handle redirects (302) and re-run the POST to the redirected target
 
Below some examples illustrating the new POST mechanism:
 
Example 1: Open a specific Webview dashboard
<html>
<body>
 
<iframe id="dummyframe" name="dummyframe" width="0" height="0" border="0"></iframe>
 
<form action="http://<webview-hostname>:8080/j_security_check" method="POST" id="myform" target="dummyframe">
<input type="hidden" name="j_username" value="<YourUserName>">
<input type="hidden" name="j_password" value="<YourUserPassword>">
</form>
<script type="text/javascript">
function redirect() { window.location = "http://<webview-hostname>:8080/#console;db=EM+Capacity;dn=SuperDomain;mm=Supportability"; }
 
window.document.getElementById("myform").submit();
setTimeout(redirect, 1500);
</script>
 
</body>
</html>
 
Example 2: Open TeamCenter \ dashboard:
 
<html>
<body>
 
<iframe id="dummyframe" name="dummyframe" width="0" height="0" border="0"></iframe>
 
<form action="http://<webview-hostname>:8080/ApmServer/j_security_check" method="POST" id="myform" target="dummyframe">
<input type="hidden" name="j_username" value="<YourUserName>">
<input type="hidden" name="j_password" value="<YourUserPassword>">
</form>
<script type="text/javascript">
function redirect() { window.location = "http://<webview-hostname>:8080/ApmServer/#/dashboard?fa=%5B%5D&ep=1&g=PE1&m=L&cht=0&chs=1&cha=0&u="; }
 
window.document.getElementById("myform").submit();
setTimeout(redirect, 1500);
</script>
 
</body>
</html>
 
Example 3 :Open TeamCenter \ Settings \ Universes tab:
 
<html>
<body>
 
<iframe id="dummyframe" name="dummyframe" width="0" height="0" border="0"></iframe>
 
<form action="http://<webview-hostname>:8080/ApmServer/j_security_check" method="POST" id="myform" target="dummyframe">
<input type="hidden" name="j_username" value="<YourUserName>">
<input type="hidden" name="j_password" value="<YourUserPassword>">
</form>
<script type="text/javascript">
function redirect() { window.location = "http://<webview-hostname>:8080/ApmServer/#/security?range=0&fa=%5B%5D&ep=1&m=L&l=ATC&u=&cht=0&chs=0&cha=0"; }
 
window.document.getElementById("myform").submit();
setTimeout(redirect, 1500);
</script>
 
</body>
</html>

If you wish to be able to simply double click a shortcut to open the desired page then the html must be placed in a file and then a shortcut can be created which starts the browser with a command line parameter of the saved html file e.g.

"C:\Program Files (x86)\Internet Explorer\iexplore.exe" file:///C:/myshortcuts/VW.htm

Simply double clicking the html file will open the browser but will still request the user credentials