Loading TOC...

MarkLogic Server 11.0 Product Documentation
sec.samlEntityInsert

sec.samlEntityInsert(
   entity as element(md.EntityDescriptor)
) as (Number|String)

Summary

This function inserts a SAML entity into the Security database.

Parameters
entity The SAML entity to be inserted.

Example


  // This function needs a XML element as an argument

  declareUpdate();
  const sec = require('/MarkLogic/security');
  const x = new NodeBuilder();

  function addCommonAttrs(b) {
    b.addAttribute("Binding","urn:oasis:names:tc:SAML:2.0:bindings:SOAP");
    b.addAttribute("Location","gordon-2:8005/AttributeQuery.xqy")
  }

  x.startElement("md:EntityDescriptor","urn:oasis:names:tc:SAML:2.0:metadata");
  x.addAttribute("entityID","http://id.example.com/example44");
  x.startElement("md:AttributeAuthorityDescriptor","urn:oasis:names:tc:SAML:2.0:metadata");
  x.addAttribute("protocolSupportEnumeration","urn:oasis:names:tc:SAML:2.0:protocol");
  x.addElement("md:AttributeService",addCommonAttrs,"urn:oasis:names:tc:SAML:2.0:metadata");
  x.endElement();
  x.endElement();

  const entity = x.toNode();

  sec.samlEntityInsert(entity);

   

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.