private Element createIDPSSODescriptor(boolean exportPrivateData) throws Exception {
  Element idpssoD=doc.createElement(SAMLNames.IDPSSODESCRIPTOR);
  idpssoD.setAttribute(SAMLNames.PSE,SAMLNames.REQUIREDPROTOCAL);
  idpssoD.setAttribute(SAMLNames.WANTSIGNED,SAMLNames.FALSE);
  if (exportPrivateData) {
    setExtensionAttributes(idpssoD);
    Element extEle=createExtensionEle();
    if (extEle != null) {
      idpssoD.appendChild(extEle);
    }
  }
  Element keyD=createKeyDescriptor(exportPrivateData);
  if (keyD != null) {
    idpssoD.appendChild(keyD);
  }
  Element sloEle=createSingleLogOutForCastleAsIDP(SAMLNames.HTTP_REDIRECT_BINDING);
  idpssoD.appendChild(sloEle);
  sloEle=createSingleLogOutForCastleAsIDP(SAMLNames.SOAP_BINDING);
  idpssoD.appendChild(sloEle);
  createNameIDFormats(idpssoD,true);
  String ssoLocationStr=convertToIPV6ShortForm(idmClient.getEntityID(tenantName));
  if (ssoLocationStr == null) {
    ssoLocationStr=tenantName;
  }
  ssoLocationStr=ssoLocationStr.replaceAll("/Metadata/","/SSO/");
  Element ssos=createEndPoint(SAMLNames.SSOS,SAMLNames.HTTP_REDIRECT_BINDING,ssoLocationStr,null);
  idpssoD.appendChild(ssos);
  createAttributesEle(idpssoD);
  return idpssoD;
}

private Element createIDPSSODescriptor ( boolean exportPrivateData ) throws Exception { Element idpssoD = doc . createElement ( SAMLNames . IDPSSODESCRIPTOR ) ; idpssoD . setAttribute ( SAMLNames . PSE , SAMLNames . REQUIREDPROTOCAL ) ; idpssoD . setAttribute ( SAMLNames . WANTSIGNED , SAMLNames . FALSE ) ; if ( exportPrivateData ) { setExtensionAttributes ( idpssoD ) ; Element extEle = createExtensionEle ( ) ; if ( extEle != null ) { idpssoD . appendChild ( extEle ) ; } } Element keyD = createKeyDescriptor ( exportPrivateData ) ; if ( keyD != null ) { idpssoD . appendChild ( keyD ) ; } Element sloEle = createSingleLogOutForCastleAsIDP ( SAMLNames . HTTP_REDIRECT_BINDING ) ; idpssoD . appendChild ( sloEle ) ; sloEle = createSingleLogOutForCastleAsIDP ( SAMLNames . SOAP_BINDING ) ; idpssoD . appendChild ( sloEle ) ; createNameIDFormats ( idpssoD , true ) ; String ssoLocationStr = convertToIPV6ShortForm ( idmClient . getEntityID ( tenantName ) ) ; if ( ssoLocationStr == null ) { ssoLocationStr = tenantName ; } ssoLocationStr = ssoLocationStr . replaceAll ( "/Metadata/" , "/SSO/" ) ; Element ssos = createEndPoint ( SAMLNames . SSOS , SAMLNames . HTTP_REDIRECT_BINDING , ssoLocationStr , null ) ; idpssoD . appendChild ( ssos ) ; createAttributesEle ( idpssoD ) ; return idpssoD ; }
create idpssoelement in dom .
