Package org.jboss.identity.federation.saml.v2.metadata

Examples of org.jboss.identity.federation.saml.v2.metadata.OrganizationType


      if(request == null)
         throw new IllegalArgumentException("request is null");
      if(responseType == null)
         throw new IllegalArgumentException("response type is null");
     
      StatusType statusType = responseType.getStatus();
      if(statusType == null)
         throw new IllegalArgumentException("Status Type from the IDP is null");

      String statusValue = statusType.getStatusCode().getValue();
      if(JBossSAMLURIConstants.STATUS_SUCCESS.get().equals(statusValue) == false)
         throw new SecurityException("IDP forbid the user");

      List<Object> assertions = responseType.getAssertionOrEncryptedAssertion();
      if(assertions.size() == 0)
View Full Code Here


      if(request == null)
         throw new IllegalArgumentException("request is null");
      if(responseType == null)
         throw new IllegalArgumentException("response type is null");
     
      StatusType statusType = responseType.getStatus();
      if(statusType == null)
         throw new IllegalArgumentException("Status Type from the IDP is null");

      String statusValue = statusType.getStatusCode().getValue();
      if(JBossSAMLURIConstants.STATUS_SUCCESS.get().equals(statusValue) == false)
         throw new SecurityException("IDP forbid the user");

      List<Object> assertions = responseType.getAssertionOrEncryptedAssertion();
      if(assertions.size() == 0)
View Full Code Here

   public static StatusType createStatusType(String statusCodeURI)
   {
      StatusCodeType sct = SAMLProtocolFactory.getObjectFactory().createStatusCodeType();
      sct.setValue(statusCodeURI);
     
      StatusType statusType = SAMLProtocolFactory.getObjectFactory().createStatusType();
      statusType.setStatusCode(sct);
      return statusType;
   }
View Full Code Here

    String organizationURL = "http://www.jboss.org";
    String lang = "en";

    @Test
    public void testCreateOrganization() {
        OrganizationType org = createJBossOrganization("en");

        assertNotNull("Org is not null", org);
        assertEquals(organizationName, org.getOrganizationName().get(0).getValue());
        assertEquals(organizationDisplayName, org.getOrganizationDisplayName().get(0).getValue());
        assertEquals(organizationURL, org.getOrganizationURL().get(0).getValue().toString());

        // Check the lang
        assertEquals(lang, org.getOrganizationName().get(0).getLang());
        assertEquals(lang, org.getOrganizationDisplayName().get(0).getLang());
        assertEquals(lang, org.getOrganizationURL().get(0).getLang());
    }
View Full Code Here

        // orgURL
        LocalizedURIType orgURL = new LocalizedURIType(lang);
        orgURL.setValue(URI.create(organizationURL));

        OrganizationType orgType = new OrganizationType();
        orgType.addOrganizationName(orgName);
        orgType.addOrganizationDisplayName(orgDisplayName);
        orgType.addOrganizationURL(orgURL);
        return orgType;
    }
View Full Code Here

     *
     * @throws Exception
     */
    @Test
    public void testDynamicMetadataCreation() throws Exception {
        OrganizationType org = new OrganizationType();
        AttributeType attributeType = new AttributeType("hello");
        List<AttributeType> attributes = new ArrayList<AttributeType>();
        attributes.add(attributeType);

        URI test = URI.create("http://test");
View Full Code Here

        assertNotNull("Inputstream not null", is);

        SAMLParser parser = new SAMLParser();
        EntityDescriptorType entity = (EntityDescriptorType) parser.parse(is);
        assertNotNull(entity);
        OrganizationType org = entity.getOrganization();
        assertNotNull(org);

        List<ContactType> contactPersons = entity.getContactPerson();
        assertNotNull(contactPersons);
        assertTrue(contactPersons.size() == 1);
View Full Code Here

            } else if (JBossSAMLConstants.PDP_DESCRIPTOR.get().equals(localPart)) {
                throw logger.unsupportedType(" PDPDescriptor");
            } else if (localPart.equals(JBossSAMLConstants.SIGNATURE.get())) {
                entityDescriptorType.setSignature(StaxParserUtil.getDOMElement(xmlEventReader));
            } else if (JBossSAMLConstants.ORGANIZATION.get().equals(localPart)) {
                OrganizationType organization = parseOrganization(xmlEventReader);

                entityDescriptorType.setOrganization(organization);
            } else if (JBossSAMLConstants.CONTACT_PERSON.get().equals(localPart)) {
                entityDescriptorType.addContactPerson(parseContactPerson(xmlEventReader));
            } else if (JBossSAMLConstants.ADDITIONAL_METADATA_LOCATION.get().equals(localPart)) {
View Full Code Here

    private OrganizationType parseOrganization(XMLEventReader xmlEventReader) throws ParsingException {
        StartElement startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
        StaxParserUtil.validate(startElement, JBossSAMLConstants.ORGANIZATION.get());

        OrganizationType org = new OrganizationType();

        while (xmlEventReader.hasNext()) {
            XMLEvent xmlEvent = StaxParserUtil.peek(xmlEventReader);
            if (xmlEvent instanceof EndElement) {
                EndElement end = StaxParserUtil.getNextEndElement(xmlEventReader);
                StaxParserUtil.validate(end, JBossSAMLConstants.ORGANIZATION.get());
                break;
            }

            startElement = (StartElement) xmlEvent;
            String localPart = startElement.getName().getLocalPart();

            if (JBossSAMLConstants.ORGANIZATION_NAME.get().equals(localPart)) {
                startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
                LocalizedNameType localName = getLocalizedName(xmlEventReader, startElement);
                org.addOrganizationName(localName);
            } else if (JBossSAMLConstants.ORGANIZATION_DISPLAY_NAME.get().equals(localPart)) {
                startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
                LocalizedNameType localName = getLocalizedName(xmlEventReader, startElement);
                org.addOrganizationDisplayName(localName);
            } else if (JBossSAMLConstants.ORGANIZATION_URL.get().equals(localPart)) {
                startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
                Attribute lang = startElement.getAttributeByName(new QName(JBossSAMLURIConstants.XML.get(), "lang"));
                String langVal = StaxParserUtil.getAttributeValue(lang);
                LocalizedURIType localName = new LocalizedURIType(langVal);
                localName.setValue(URI.create(StaxParserUtil.getElementText(xmlEventReader)));
                org.addOrganizationURL(localName);
            } else if (JBossSAMLConstants.EXTENSIONS.get().equalsIgnoreCase(localPart)) {
                org.setExtensions(parseExtensions(xmlEventReader));
            } else
                throw logger.parserUnknownTag(localPart, startElement.getLocation());
        }
        return org;
    }
View Full Code Here

                PDPDescriptorType pdpDesc = edtDescChoice.getPdpDescriptor();
                if (pdpDesc != null)
                    throw logger.notImplementedYet("PDPDescriptorType");
            }
        }
        OrganizationType organization = entityDescriptor.getOrganization();
        if (organization != null) {
            writeOrganization(organization);
        }

        List<ContactType> contactPersons = entityDescriptor.getContactPerson();
View Full Code Here

TOP

Related Classes of org.jboss.identity.federation.saml.v2.metadata.OrganizationType

Copyright © 2018 www.massapicom. 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.