code: protected IdPAttribute prepareNameIdAttribute(final Object casAssertion,
                                                    final String nameFormat,
                                                    final SamlRegisteredServiceServiceProviderMetadataFacade adaptor) {
          val assertion = Assertion.class.cast(casAssertion);
          val attribute = new IdPAttribute(AttributePrincipal.class.getName());
  
          val principalName = assertion.getPrincipal().getName();
          LOGGER.debug("Preparing NameID attribute for principal [{}]", principalName);
  
          val nameIdValue = getNameIdValueFromNameFormat(nameFormat, adaptor, principalName);
          val value = new StringAttributeValue(nameIdValue);
          LOGGER.debug("NameID attribute value is set to [{}]", value);
          attribute.setValues(CollectionUtils.wrap(value));
          return attribute;
      }
docs: Prepare name id attribute id p attribute.
  
  @param casAssertion the assertion
  @param nameFormat   the name format
  @param adaptor      the adaptor
  @return the idp attribute