Examples of EntitiesDescriptorType


Examples of org.jboss.seam.security.external.jaxb.samlv2.metadata.EntitiesDescriptorType

    protected void readEntitiesDescriptor(Reader reader) {
        try {
            Unmarshaller unmarshaller = metaDataJaxbContext.createUnmarshaller();
            JAXBElement<?> o = (JAXBElement<?>) unmarshaller.unmarshal(reader);
            EntitiesDescriptorType entitiesDescriptor = (EntitiesDescriptorType) o.getValue();
            readEntitiesDescriptor(entitiesDescriptor);
        } catch (JAXBException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of org.jboss.seam.security.external.jaxb.samlv2.metadata.EntitiesDescriptorType

        for (Object object : entitiesDescriptor.getEntityDescriptorOrEntitiesDescriptor()) {
            if (object instanceof EntityDescriptorType) {
                EntityDescriptorType entityDescriptor = (EntityDescriptorType) object;
                readEntityDescriptor(entityDescriptor);
            } else {
                EntitiesDescriptorType descriptor = (EntitiesDescriptorType) object;
                readEntitiesDescriptor(descriptor);
            }
        }
    }
View Full Code Here

Examples of org.jboss.seam.security.external.jaxb.samlv2.metadata.EntitiesDescriptorType

   {
      try
      {
         Unmarshaller unmarshaller = metaDataJaxbContext.createUnmarshaller();
         JAXBElement<?> o = (JAXBElement<?>) unmarshaller.unmarshal(reader);
         EntitiesDescriptorType entitiesDescriptor = (EntitiesDescriptorType) o.getValue();
         readEntitiesDescriptor(entitiesDescriptor);
      }
      catch (JAXBException e)
      {
         throw new RuntimeException(e);
View Full Code Here

Examples of org.jboss.seam.security.external.jaxb.samlv2.metadata.EntitiesDescriptorType

            EntityDescriptorType entityDescriptor = (EntityDescriptorType) object;
            readEntityDescriptor(entityDescriptor);
         }
         else
         {
            EntitiesDescriptorType descriptor = (EntitiesDescriptorType) object;
            readEntitiesDescriptor(descriptor);
         }
      }
   }
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.metadata.EntitiesDescriptorType

        try {
            metadata = new SAMLParser().parse(is);
        } catch (ParsingException e) {
            throw new RuntimeException(e);
        }
        EntitiesDescriptorType entities;

        if (EntitiesDescriptorType.class.isInstance(metadata)) {
            entities = (EntitiesDescriptorType) metadata;
        } else {
            entities = new EntitiesDescriptorType();
            entities.addEntityDescriptor(metadata);
        }

        for (Object o : entities.getEntityDescriptor()) {
            EntityDescriptorType entity = (EntityDescriptorType)o;
            String entityId = entity.getEntityID();
            ApplicationModel app = realm.addApplication(entityId);
            app.setFullScopeAllowed(true);
            app.setProtocol(SamlProtocol.LOGIN_PROTOCOL);
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.metadata.EntitiesDescriptorType

        assertEquals(spSSODescriptor.getSingleLogoutService().size(), 4);
    }

    public void testFileBasedEntitiesMetadataProvider() {
        FileBasedEntitiesMetadataProvider metadataProvider = new FileBasedEntitiesMetadataProvider();
        EntitiesDescriptorType metadata = getMetadata(metadataProvider, "saml2/metadata/sp-two-salesforce-googleapps.xml");

        List<Object> descriptors = metadata.getEntityDescriptor();
        for (Object descriptorType : descriptors) {
            if (!(descriptorType instanceof EntityDescriptorType)) {
                fail("Wrong type: " + descriptorType.getClass());
            }
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.metadata.EntitiesDescriptorType

            metadataProvider.injectFileStream(servletContext.getResourceAsStream(fileInjectionStr));
        }

        List<EntityDescriptorType> resultList = new ArrayList<EntityDescriptorType>();
        if (metadataProvider.isMultiple()) {
            EntitiesDescriptorType metadatas = (EntitiesDescriptorType) metadataProvider.getMetaData();
            addAllEntityDescriptorsRecursively(resultList, metadatas);
        } else {
            EntityDescriptorType metadata = (EntityDescriptorType) metadataProvider.getMetaData();
            resultList.add(metadata);
        }
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.metadata.EntitiesDescriptorType

        xmlEventReader = filterWhiteSpaceCharacters(xmlEventReader);

        StartElement startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
        StaxParserUtil.validate(startElement, EDT);

        EntitiesDescriptorType entitiesDescriptorType = new EntitiesDescriptorType();

        // Parse the attributes
        Attribute validUntil = startElement.getAttributeByName(new QName(JBossSAMLConstants.VALID_UNTIL.get()));
        if (validUntil != null) {
            String validUntilValue = StaxParserUtil.getAttributeValue(validUntil);
            entitiesDescriptorType.setValidUntil(XMLTimeUtil.parse(validUntilValue));
        }

        Attribute id = startElement.getAttributeByName(new QName(JBossSAMLConstants.ID.get()));
        if (id != null) {
            entitiesDescriptorType.setID(StaxParserUtil.getAttributeValue(id));
        }

        Attribute name = startElement.getAttributeByName(new QName(JBossSAMLConstants.NAME.get()));
        if (name != null) {
            entitiesDescriptorType.setName(StaxParserUtil.getAttributeValue(name));
        }

        Attribute cacheDuration = startElement.getAttributeByName(new QName(JBossSAMLConstants.CACHE_DURATION.get()));
        if (cacheDuration != null) {
            entitiesDescriptorType
                    .setCacheDuration(XMLTimeUtil.parseAsDuration(StaxParserUtil.getAttributeValue(cacheDuration)));
        }

        // Get the Child Elements
        while (xmlEventReader.hasNext()) {
            XMLEvent xmlEvent = StaxParserUtil.peek(xmlEventReader);
            if (xmlEvent instanceof EndElement) {
                StaxParserUtil.validate((EndElement) xmlEvent, EDT);
                StaxParserUtil.getNextEndElement(xmlEventReader);
                break;
            }
            startElement = (StartElement) xmlEvent;
            String localPart = startElement.getName().getLocalPart();

            if (JBossSAMLConstants.ENTITY_DESCRIPTOR.get().equals(localPart)) {
                SAMLEntityDescriptorParser entityParser = new SAMLEntityDescriptorParser();
                entitiesDescriptorType.addEntityDescriptor(entityParser.parse(xmlEventReader));
            } else if (JBossSAMLConstants.EXTENSIONS.get().equalsIgnoreCase(localPart)) {
                entitiesDescriptorType.setExtensions(parseExtensions(xmlEventReader));
            } else if (JBossSAMLConstants.ENTITIES_DESCRIPTOR.get().equalsIgnoreCase(localPart)) {
                SAMLEntitiesDescriptorParser parser = new SAMLEntitiesDescriptorParser();
                entitiesDescriptorType.addEntityDescriptor(parser.parse(xmlEventReader));
            } else if (localPart.equals(JBossSAMLConstants.SIGNATURE.get())) {
                entitiesDescriptorType.setSignature(StaxParserUtil.getDOMElement(xmlEventReader));
            } else
                throw logger.parserUnknownTag(localPart, startElement.getLocation());
        }
        return entitiesDescriptorType;
    }
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.metadata.EntitiesDescriptorType

     */
    public SPType getSPConfiguration() throws ProcessingException {
        SPType spType = null;
        if (fileAvailable()) {
            try {
                EntitiesDescriptorType entities = parseMDFile();
                spType = CoreConfigUtil.getSPConfiguration(entities, bindingURI);
            } catch (ParsingException e) {
                throw logger.processingError(e);
            } catch (ConfigurationException ce) {
                throw logger.processingError(ce);
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.metadata.EntitiesDescriptorType

        SPType spType = null;
        if (fileAvailable()) {
            try {
                Object metadata = parseMDFile();
                if (metadata instanceof EntitiesDescriptorType) {
                    EntitiesDescriptorType entities = (EntitiesDescriptorType) metadata;
                    spType = CoreConfigUtil.getSPConfiguration(entities, bindingURI);
                } else if (metadata instanceof EntityDescriptorType) {
                    EntityDescriptorType entity = (EntityDescriptorType) metadata;
                    spType = (SPType) CoreConfigUtil.getSPConfiguration(entity, bindingURI);
                } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.