for (EDTChoiceType edtChoiceType : edtChoiceTypeList) List<EDTDescriptorChoiceType> edtDescriptorChoiceTypeList = edtChoiceType.getDescriptors(); for (EDTDescriptorChoiceType edtDesc : edtDescriptorChoiceTypeList)
/** * Create an Entity Descriptor * * @param idpOrSPDescriptor a descriptor for either the IDP or SSO * * @return */ public static EntityDescriptorType createEntityDescriptor(SSODescriptorType idpOrSPDescriptor) { EDTDescriptorChoiceType edtDescriptorChoiceType = new EDTDescriptorChoiceType(idpOrSPDescriptor); List<EDTDescriptorChoiceType> edtList = new ArrayList<EntityDescriptorType.EDTDescriptorChoiceType>(); edtList.add(edtDescriptorChoiceType); EDTChoiceType choiceType = new EDTChoiceType(edtList); EntityDescriptorType entity = new EntityDescriptorType(" "); entity.addChoiceType(choiceType); return entity; }
@Override public EntityDescriptorType getMetaData() { ArrayList<String> protocols = new ArrayList<String>(); protocols.add(PROTOCOL); SPSSODescriptorType spSSO = new SPSSODescriptorType(protocols); spSSO.setAuthnRequestsSigned(true); spSSO.setWantAssertionsSigned(true); if (bindingUri!=null && logoutPage != null) { EndpointType endpointType = new EndpointType(URI.create(bindingUri), URI.create(logoutPage)); endpointType.setResponseLocation(URI.create(logoutResponseLocation)); spSSO.addSingleLogoutService(endpointType); } IndexedEndpointType assertionConsumerSvc = new IndexedEndpointType(URI.create(bindingUri), URI.create(serviceUrl)); assertionConsumerSvc.setIsDefault(true); spSSO.addAssertionConsumerService(assertionConsumerSvc); if (serviceName != null) { spSSO.addAttributeConsumerService(getAttributeConsumerService()); if(nameIdFormat != null) { spSSO.addNameIDFormat(nameIdFormat); } } EntityDescriptorType.EDTDescriptorChoiceType edtDescChoice = new EntityDescriptorType.EDTDescriptorChoiceType(spSSO); EntityDescriptorType.EDTChoiceType edtChoice = EntityDescriptorType.EDTChoiceType.oneValue(edtDescChoice); EntityDescriptorType entityDescriptor = new EntityDescriptorType(entityId); entityDescriptor.addChoiceType(edtChoice); return entityDescriptor; }
EDTChoiceType edtChoice = EDTChoiceType.oneValue(edtDescChoice); entityDescriptorType.addChoiceType(edtChoice); EDTChoiceType edtChoice = EDTChoiceType.oneValue(edtDescChoice); entityDescriptorType.addChoiceType(edtChoice); EDTChoiceType edtChoice = EDTChoiceType.oneValue(edtDescChoice); entityDescriptorType.addChoiceType(edtChoice);
EDTChoiceType edtChoice = EDTChoiceType.oneValue(edtDescChoice); entityDescriptorType.addChoiceType(edtChoice); EDTChoiceType edtChoice = EDTChoiceType.oneValue(edtDescChoice); entityDescriptorType.addChoiceType(edtChoice); EDTChoiceType edtChoice = EDTChoiceType.oneValue(edtDescChoice); entityDescriptorType.addChoiceType(edtChoice);
EDTChoiceType edtChoice = EDTChoiceType.oneValue(edtDescChoice); entityDescriptorType.addChoiceType(edtChoice); } else if (JBossSAMLConstants.SP_SSO_DESCRIPTOR.get().equals(localPart)) { EDTChoiceType edtChoice = EDTChoiceType.oneValue(edtDescChoice); entityDescriptorType.addChoiceType(edtChoice); } else if (JBossSAMLConstants.ATTRIBUTE_AUTHORITY_DESCRIPTOR.get().equals(localPart)) { EDTChoiceType edtChoice = EDTChoiceType.oneValue(edtDescChoice); entityDescriptorType.addChoiceType(edtChoice); } else if (JBossSAMLConstants.AUTHN_AUTHORITY_DESCRIPTOR.get().equals(localPart)) { EDTChoiceType edtChoice = EDTChoiceType.oneValue(edtDescChoice);
for (EDTChoiceType edtChoice : choiceTypes) AffiliationDescriptorType affliationDesc = edtChoice.getAffiliationDescriptor(); if (affliationDesc != null) throw new RuntimeException(ErrorCodes.NOT_IMPLEMENTED_YET + "affliation"); //TODO: affiliation List<EDTDescriptorChoiceType> edtDescChoices = edtChoice.getDescriptors(); for (EDTDescriptorChoiceType edtDescChoice : edtDescChoices)
EDTChoiceType edtChoice = EDTChoiceType.oneValue(edtDescChoice); entityDescriptorType.addChoiceType(edtChoice); } else if (JBossSAMLConstants.SP_SSO_DESCRIPTOR.get().equals(localPart)) { EDTChoiceType edtChoice = EDTChoiceType.oneValue(edtDescChoice); entityDescriptorType.addChoiceType(edtChoice); } else if (JBossSAMLConstants.ATTRIBUTE_AUTHORITY_DESCRIPTOR.get().equals(localPart)) { EDTChoiceType edtChoice = EDTChoiceType.oneValue(edtDescChoice); entityDescriptorType.addChoiceType(edtChoice); } else if (JBossSAMLConstants.AUTHN_AUTHORITY_DESCRIPTOR.get().equals(localPart)) { EDTChoiceType edtChoice = EDTChoiceType.oneValue(edtDescChoice);
for (EDTChoiceType edtChoice : choiceTypes) AffiliationDescriptorType affliationDesc = edtChoice.getAffiliationDescriptor(); if (affliationDesc != null) throw new RuntimeException(ErrorCodes.NOT_IMPLEMENTED_YET + "affliation"); //TODO: affiliation List<EDTDescriptorChoiceType> edtDescChoices = edtChoice.getDescriptors(); for (EDTDescriptorChoiceType edtDescChoice : edtDescChoices)
EDTChoiceType edtChoice = EDTChoiceType.oneValue(edtDescChoice); entityDescriptorType.addChoiceType(edtChoice); } else if (JBossSAMLConstants.SP_SSO_DESCRIPTOR.get().equals(localPart)) { EDTChoiceType edtChoice = EDTChoiceType.oneValue(edtDescChoice); entityDescriptorType.addChoiceType(edtChoice); } else if (JBossSAMLConstants.ATTRIBUTE_AUTHORITY_DESCRIPTOR.get().equals(localPart)) { EDTChoiceType edtChoice = EDTChoiceType.oneValue(edtDescChoice); entityDescriptorType.addChoiceType(edtChoice); } else if (JBossSAMLConstants.AUTHN_AUTHORITY_DESCRIPTOR.get().equals(localPart)) {
AffiliationDescriptorType affliationDesc = edtChoice.getAffiliationDescriptor(); if (affliationDesc != null) throw logger.notImplementedYet("affliation"); // TODO: affiliation List<EDTDescriptorChoiceType> edtDescChoices = edtChoice.getDescriptors(); for (EDTDescriptorChoiceType edtDescChoice : edtDescChoices) { RoleDescriptorType roleDesc = edtDescChoice.getRoleDescriptor();
AffiliationDescriptorType affliationDesc = edtChoice.getAffiliationDescriptor(); if (affliationDesc != null) throw logger.notImplementedYet("affliation"); // TODO: affiliation List<EDTDescriptorChoiceType> edtDescChoices = edtChoice.getDescriptors(); for (EDTDescriptorChoiceType edtDescChoice : edtDescChoices) { RoleDescriptorType roleDesc = edtDescChoice.getRoleDescriptor();
AffiliationDescriptorType affliationDesc = edtChoice.getAffiliationDescriptor(); if (affliationDesc != null) throw logger.notImplementedYet("affliation"); // TODO: affiliation List<EDTDescriptorChoiceType> edtDescChoices = edtChoice.getDescriptors(); for (EDTDescriptorChoiceType edtDescChoice : edtDescChoices) { RoleDescriptorType roleDesc = edtDescChoice.getRoleDescriptor();
for (EDTChoiceType edtChoiceType : edtChoiceTypeList) List<EDTDescriptorChoiceType> edtDescriptorChoiceTypeList = edtChoiceType.getDescriptors(); for (EDTDescriptorChoiceType edtDesc : edtDescriptorChoiceTypeList)
/** * @see IMetadataConfigurationStore#persist(EntityDescriptorType, String) */ public void persist(EntityDescriptorType entity, String id) throws IOException { File persistedFile = validateIdAndReturnMDFile(id); try { XMLStreamWriter streamWriter = StaxUtil.getXMLStreamWriter(new FileOutputStream(persistedFile)); SAMLMetadataWriter writer = new SAMLMetadataWriter(streamWriter); writer.writeEntityDescriptor(entity); } catch (ProcessingException e) { throw new RuntimeException(e); } logger.trace("Persisted entity descriptor into " + persistedFile.getPath()); // Process the EDT List<EDTChoiceType> edtChoiceTypeList = entity.getChoiceType(); for (EDTChoiceType edtChoiceType : edtChoiceTypeList) { List<EDTDescriptorChoiceType> edtDescriptorChoiceTypeList = edtChoiceType.getDescriptors(); for (EDTDescriptorChoiceType edtDesc : edtDescriptorChoiceTypeList) { IDPSSODescriptorType idpSSO = edtDesc.getIdpDescriptor(); if (idpSSO != null) { addIdentityProvider(id); } SPSSODescriptorType spSSO = edtDesc.getSpDescriptor(); if (spSSO != null) { addServiceProvider(id); } } } }
/** * @see IMetadataConfigurationStore#persist(EntityDescriptorType, String) */ public void persist(EntityDescriptorType entity, String id) throws IOException { File persistedFile = validateIdAndReturnMDFile(id); try { XMLStreamWriter streamWriter = StaxUtil.getXMLStreamWriter(new FileOutputStream(persistedFile)); SAMLMetadataWriter writer = new SAMLMetadataWriter(streamWriter); writer.writeEntityDescriptor(entity); } catch (ProcessingException e) { throw new RuntimeException(e); } logger.trace("Persisted entity descriptor into " + persistedFile.getPath()); // Process the EDT List<EDTChoiceType> edtChoiceTypeList = entity.getChoiceType(); for (EDTChoiceType edtChoiceType : edtChoiceTypeList) { List<EDTDescriptorChoiceType> edtDescriptorChoiceTypeList = edtChoiceType.getDescriptors(); for (EDTDescriptorChoiceType edtDesc : edtDescriptorChoiceTypeList) { IDPSSODescriptorType idpSSO = edtDesc.getIdpDescriptor(); if (idpSSO != null) { addIdentityProvider(id); } SPSSODescriptorType spSSO = edtDesc.getSpDescriptor(); if (spSSO != null) { addServiceProvider(id); } } } }
private void updateKeyDescriptor(EntityDescriptorType entityD, KeyDescriptorType keyD) { List<EDTDescriptorChoiceType> objs = entityD.getChoiceType().get(0).getDescriptors(); if (objs != null) { for (EDTDescriptorChoiceType choiceTypeDesc : objs) { AttributeAuthorityDescriptorType attribDescriptor = choiceTypeDesc.getAttribDescriptor(); if (attribDescriptor != null) attribDescriptor.addKeyDescriptor(keyD); AuthnAuthorityDescriptorType authnDescriptor = choiceTypeDesc.getAuthnDescriptor(); if (authnDescriptor != null) authnDescriptor.addKeyDescriptor(keyD); IDPSSODescriptorType idpDescriptor = choiceTypeDesc.getIdpDescriptor(); if (idpDescriptor != null) idpDescriptor.addKeyDescriptor(keyD); PDPDescriptorType pdpDescriptor = choiceTypeDesc.getPdpDescriptor(); if (pdpDescriptor != null) pdpDescriptor.addKeyDescriptor(keyD); RoleDescriptorType roleDescriptor = choiceTypeDesc.getRoleDescriptor(); if (roleDescriptor != null) roleDescriptor.addKeyDescriptor(keyD); SPSSODescriptorType spDescriptorType = choiceTypeDesc.getSpDescriptor(); if (spDescriptorType != null) spDescriptorType.addKeyDescriptor(keyD); } } } }
private void updateKeyDescriptor(EntityDescriptorType entityD, KeyDescriptorType keyD) { List<EDTDescriptorChoiceType> objs = entityD.getChoiceType().get(0).getDescriptors(); if (objs != null) { for (EDTDescriptorChoiceType choiceTypeDesc : objs) { AttributeAuthorityDescriptorType attribDescriptor = choiceTypeDesc.getAttribDescriptor(); if (attribDescriptor != null) attribDescriptor.addKeyDescriptor(keyD); AuthnAuthorityDescriptorType authnDescriptor = choiceTypeDesc.getAuthnDescriptor(); if (authnDescriptor != null) authnDescriptor.addKeyDescriptor(keyD); IDPSSODescriptorType idpDescriptor = choiceTypeDesc.getIdpDescriptor(); if (idpDescriptor != null) idpDescriptor.addKeyDescriptor(keyD); PDPDescriptorType pdpDescriptor = choiceTypeDesc.getPdpDescriptor(); if (pdpDescriptor != null) pdpDescriptor.addKeyDescriptor(keyD); RoleDescriptorType roleDescriptor = choiceTypeDesc.getRoleDescriptor(); if (roleDescriptor != null) roleDescriptor.addKeyDescriptor(keyD); SPSSODescriptorType spDescriptorType = choiceTypeDesc.getSpDescriptor(); if (spDescriptorType != null) spDescriptorType.addKeyDescriptor(keyD); } } } }
/** * @see IMetadataConfigurationStore#persist(EntityDescriptorType, String) */ public void persist(EntityDescriptorType entity, String id) throws IOException { File persistedFile = validateIdAndReturnMDFile(id); try { XMLStreamWriter streamWriter = StaxUtil.getXMLStreamWriter(new FileOutputStream(persistedFile)); SAMLMetadataWriter writer = new SAMLMetadataWriter(streamWriter); writer.writeEntityDescriptor(entity); } catch (ProcessingException e) { throw new RuntimeException(e); } logger.trace("Persisted entity descriptor into " + persistedFile.getPath()); // Process the EDT List<EDTChoiceType> edtChoiceTypeList = entity.getChoiceType(); for (EDTChoiceType edtChoiceType : edtChoiceTypeList) { List<EDTDescriptorChoiceType> edtDescriptorChoiceTypeList = edtChoiceType.getDescriptors(); for (EDTDescriptorChoiceType edtDesc : edtDescriptorChoiceTypeList) { IDPSSODescriptorType idpSSO = edtDesc.getIdpDescriptor(); if (idpSSO != null) { addIdentityProvider(id); } SPSSODescriptorType spSSO = edtDesc.getSpDescriptor(); if (spSSO != null) { addServiceProvider(id); } } } }
@Override public EntityDescriptorType getMetaData() { ArrayList<String> protocols = new ArrayList<String>(); protocols.add(PROTOCOL); SPSSODescriptorType spSSO = new SPSSODescriptorType(protocols); spSSO.setAuthnRequestsSigned(true); spSSO.setWantAssertionsSigned(true); if (bindingUri!=null && logoutPage != null) { EndpointType endpointType = new EndpointType(URI.create(bindingUri), URI.create(logoutPage)); endpointType.setResponseLocation(URI.create(logoutResponseLocation)); spSSO.addSingleLogoutService(endpointType); } IndexedEndpointType assertionConsumerSvc = new IndexedEndpointType(URI.create(bindingUri), URI.create(serviceUrl)); assertionConsumerSvc.setIsDefault(true); spSSO.addAssertionConsumerService(assertionConsumerSvc); if (serviceName != null) { spSSO.addAttributeConsumerService(getAttributeConsumerService()); if(nameIdFormat != null) { spSSO.addNameIDFormat(nameIdFormat); } } EntityDescriptorType.EDTDescriptorChoiceType edtDescChoice = new EntityDescriptorType.EDTDescriptorChoiceType(spSSO); EntityDescriptorType.EDTChoiceType edtChoice = EntityDescriptorType.EDTChoiceType.oneValue(edtDescChoice); EntityDescriptorType entityDescriptor = new EntityDescriptorType(entityId); entityDescriptor.addChoiceType(edtChoice); return entityDescriptor; }