@Override public EntityDescriptor generateMetadata() { EntityDescriptor result = super.generateMetadata(); result.setID(SAMLUtil.getNCNameString(result.getEntityID())); return result; }
@Override public EntityDescriptor generateMetadata() { EntityDescriptor result = super.generateMetadata(); result.setID(SAMLUtil.getNCNameString(result.getEntityID())); return result; }
public EntityDescriptor generateMetadata() { boolean wantAuthnRequestSigned = isWantAuthnRequestSigned(); Collection<String> includedNameID = getNameID(); String entityId = getEntityId(); String entityBaseURL = getEntityBaseURL(); String entityAlias = getEntityAlias(); validateRequiredAttributes(entityId, entityBaseURL); if (id == null) { // Use entityID cleaned as NCName for ID in case no value is provided id = SAMLUtil.getNCNameString(entityId); } @SuppressWarnings("unchecked") SAMLObjectBuilder<EntityDescriptor> builder = (SAMLObjectBuilder<EntityDescriptor>) builderFactory .getBuilder(EntityDescriptor.DEFAULT_ELEMENT_NAME); EntityDescriptor descriptor = builder.buildObject(); if (id != null) { descriptor.setID(id); } descriptor.setEntityID(entityId); IDPSSODescriptor ssoDescriptor = buildIDPSSODescriptor(entityBaseURL, entityAlias, wantAuthnRequestSigned, includedNameID); if (ssoDescriptor != null) { descriptor.getRoleDescriptors().add(ssoDescriptor); } return descriptor; }
/** {@inheritDoc} */ protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException { EntityDescriptor entityDescriptor = (EntityDescriptor) samlObject; if (attribute.getLocalName().equals(EntityDescriptor.ENTITY_ID_ATTRIB_NAME)) { entityDescriptor.setEntityID(attribute.getValue()); } else if (attribute.getLocalName().equals(EntityDescriptor.ID_ATTRIB_NAME)) { entityDescriptor.setID(attribute.getValue()); attribute.getOwnerElement().setIdAttributeNode(attribute, true); } else if (attribute.getLocalName().equals(TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_NAME) && !DatatypeHelper.isEmpty(attribute.getValue())) { entityDescriptor.setValidUntil(new DateTime(attribute.getValue(), ISOChronology.getInstanceUTC())); } else if (attribute.getLocalName().equals(CacheableSAMLObject.CACHE_DURATION_ATTRIB_NAME)) { entityDescriptor.setCacheDuration(XMLHelper.durationToLong(attribute.getValue())); } else { QName attribQName = XMLHelper.getNodeQName(attribute); if (attribute.isId()) { entityDescriptor.getUnknownAttributes().registerID(attribQName); } entityDescriptor.getUnknownAttributes().put(attribQName, attribute.getValue()); } } }
public EntityDescriptor generateMetadata() { boolean requestSigned = isRequestSigned(); boolean assertionSigned = isWantAssertionSigned(); Collection<String> includedNameID = getNameID(); String entityId = getEntityId(); String entityBaseURL = getEntityBaseURL(); String entityAlias = getEntityAlias(); validateRequiredAttributes(entityId, entityBaseURL); if (id == null) { // Use entityID cleaned as NCName for ID in case no value is provided id = SAMLUtil.getNCNameString(entityId); } SAMLObjectBuilder<EntityDescriptor> builder = (SAMLObjectBuilder<EntityDescriptor>) builderFactory.getBuilder(EntityDescriptor.DEFAULT_ELEMENT_NAME); EntityDescriptor descriptor = builder.buildObject(); if (id != null) { descriptor.setID(id); } descriptor.setEntityID(entityId); SPSSODescriptor ssoDescriptor = buildSPSSODescriptor(entityBaseURL, entityAlias, requestSigned, assertionSigned, includedNameID); if (ssoDescriptor != null) { descriptor.getRoleDescriptors().add(ssoDescriptor); } return descriptor; }
EntityDescriptor entityDescriptor = buildSAMLObject(EntityDescriptor.class, EntityDescriptor.DEFAULT_ELEMENT_NAME); entityDescriptor.setEntityID(idpConfiguration.getEntityId()); entityDescriptor.setID(SAMLBuilder.randomSAMLId()); entityDescriptor.setValidUntil(new DateTime().plusMillis(86400000));