
{
"routes": [
{
"source": "^/odata.svc/(.*)$",
"destination": "tdash-odata-service",
"authenticationType": "xsuaa"
},
{
"source": "^/api/(.*)$",
"destination": "tdash-service",
"authenticationType": "xsuaa"
},
{
"source": "^/swagger.*",
"destination": "tdash-service-swagger",
"authenticationType": "xsuaa"
},
{
"source": "^/v2/.*",
"destination": "tdash-service-swagger",
"authenticationType": "xsuaa"
},
{
"source": "^/webjars/.*",
"destination": "tdash-service-swagger",
"authenticationType": "xsuaa"
},
{
"source": "^/logged-out.html$",
"localDir": "resources",
"authenticationType": "none"
},
{
"source": "^/(.*)$",
"localDir": "resources",
"authenticationType": "xsuaa"
}
],
"logout": {
"logoutEndpoint": "/logout",
"logoutPage": "/logged-out.html"
}
}
The application's xs-app.json file.
applications:
# Application Router
- name: tdash
routes:
- route: tdash((DASH))((UNIQUE_ID)).((LANDSCAPE_APPS_DOMAIN))
path: src
buildpacks:
- nodejs_buildpack
memory: 128M
stack: cflinuxfs3
services:
- xsuaa
- logging
env:
SESSION_TIMEOUT: 120
destinations: >
[
{
"name":"tdash-service",
"url":"https://tdash-service((DASH))((UNIQUE_ID)).((LANDSCAPE_APPS_DOMAIN))",
"forwardAuthToken": true
},
{
"name":"tdash-service-swagger",
"url":"https://tdash-service((DASH))((UNIQUE_ID)).((LANDSCAPE_APPS_DOMAIN))"
},
{
"name":"tdash-odata-service",
"url":"https://tdash-odata-service((DASH))((UNIQUE_ID)).((LANDSCAPE_APPS_DOMAIN))",
"forwardAuthToken": true
}
]
The approuter's manifest.yml file
$ cf push -f manifest.yml --vars-file ../qa-vars.yml
# a path fragment to make the urls unique
UNIQUE_ID: "qa"
DASH: "-"
TDASH_RELEASE: 0.11.0.LATEST
# Choose cfapps.eu10.hana.ondemand.com for the EU10 landscape, cfapps.us10.hana.ondemand.com for US10
#LANDSCAPE_APPS_DOMAIN: cfapps.us10.hana.ondemand.com
LANDSCAPE_APPS_DOMAIN: cfapps.eu10.hana.ondemand.com
# the tdash RESTful web service and GitHub interface
MEMORY_TDASH_SERVICE_APP: 1024M
BUILDPACK_TDASH_SERVICE_APP: sap_java_buildpack
/**
* Set to correspond to something less than the SESSION_TIMEOUT value that you set for your approuter
* @see https://help.sap.com/viewer/4505d0bdaf4948449b7f7379d24d0f0d/2.0.04/en-US/5f77e58ec01b46f6b64ee1e2af...
*/
countdown: 840000, /* 14 minutes; SESSION_TIMEOUT defaults to 15 minutes */
resetCountdown: 840000,
/**
* Return number of milliseconds left till automatic logout
*/
getInactivityTimeout: function() {
return this.countdown;
},
/**
* Set number of minutes left till automatic logout
*/
setInactivityTimeout: function(timeout_millisec) {
this.countdown = timeout_millisec;
this.resetCountdown = this.countdown;
},
/**
* Set number of minutes left till automatic logout
*/
resetInactivityTimeout: function() {
this.countdown = this.resetCountdown;
},
/**
* Begin counting tracking inactivity
*/
startInactivityTimer: function() {
var self = this;
this.intervalHandle = setInterval(function() {
self._inactivityCountdown();
}, 10000);
},
stopInactivityTimer: function() {
if (this.intervalHandle != null) {
clearInterval(this.intervalHandle);
this.intervalHandle = null;
}
},
_inactivityCountdown: function() {
this.countdown -= 10000;
if (this.countdown <= 0) {
this.stopInactivityTimer();
this.resetInactivityTimeout();
window.location.href = '/logout';
}
}
this.setInactivityTimeout(118 * 60 * 1000);
this.startInactivityTimer();
var self = this;
/**
* Each time a request is issued, reset the inactivity countdown
*/
this.getModel().attachRequestCompleted(function (oEvent) {
self.resetInactivityTimeout();
}, this);
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Logged out</title>
<style>
p.normal {
font-family: "Arial", sans-serif;
text-indent: 150px;
}
a {
font-family: "Arial", sans-serif;
text-indent: 150px;
}
button {
font-family: "Arial", sans-serif;
font-size: 13pt;
padding: 15px 32px;
}
h1 {
font-family: "Arial", sans-serif;
text-indent: 150px;
}
h2 {
font-family: "Arial", sans-serif;
}
h3 {
font-family: "Arial", sans-serif;
}
.login {
text-indent: 150px;
}
.header {
display: block;
padding: 1em 0 .95em;
font-family: "Arial", sans-serif;
font-size: 22px;
background: #007c99;
color: #fff;
-webkit-font-smoothing: antialiased;
}
</style>
<script>
// This function forces a reload of the destination page from the server. It does this by
// supplying a unique argument value with each new invocation.
function refreshMain() {
var unique = new Date().getTime().toString(16);
window.location.href = "/?force="+unique;
}
</script>
</head>
<body>
<div class="header">
<h1>TDash</h1>
</div>
<div class="login">
<h2>You are now logged out</h2>
<p><button onclick="refreshMain()">Return to the application</button></p>
</div>
</body>
</html>
this.setInactivityTimeout(2 * 60 * 1000);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
14 | |
11 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 |