aboutsummaryrefslogtreecommitdiff
path: root/id/ConfigWebTool/src
diff options
context:
space:
mode:
Diffstat (limited to 'id/ConfigWebTool/src')
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/auth/pvp2/BuildMetadata.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/auth/pvp2/BuildMetadata.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/auth/pvp2/BuildMetadata.java
index 56f593ce7..9a0f73a1f 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/auth/pvp2/BuildMetadata.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/auth/pvp2/BuildMetadata.java
@@ -45,6 +45,7 @@ import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.apache.log4j.Logger;
+import org.joda.time.DateTime;
import org.opensaml.Configuration;
import org.opensaml.common.impl.SecureRandomIdentifierGenerator;
import org.opensaml.common.xml.SAMLConstants;
@@ -87,6 +88,8 @@ public class BuildMetadata extends HttpServlet {
private static final Logger log = Logger.getLogger(BuildMetadata.class);
+ private static final int VALIDUNTIL_IN_HOURS = 24;
+
/**
* @see HttpServlet#HttpServlet()
*/
@@ -118,6 +121,9 @@ public class BuildMetadata extends HttpServlet {
EntitiesDescriptor spEntitiesDescriptor = SAML2Utils.
createSAMLObject(EntitiesDescriptor.class);
+ DateTime date = new DateTime();
+ spEntitiesDescriptor.setValidUntil(date.plusHours(VALIDUNTIL_IN_HOURS));
+
String name = config.getPVP2MetadataEntitiesName();
if (MiscUtil.isEmpty(name)) {
log.info("NO Metadata EntitiesName configurated");
@@ -130,6 +136,8 @@ public class BuildMetadata extends HttpServlet {
EntityDescriptor spEntityDescriptor = SAML2Utils
.createSAMLObject(EntityDescriptor.class);
+ spEntityDescriptor.setValidUntil(date.plusDays(VALIDUNTIL_IN_HOURS));
+
spEntitiesDescriptor.getEntityDescriptors().add(spEntityDescriptor);
String serviceURL = config.getPublicUrlPreFix(request);