protected String prepareNameIdAttribute(final SamlProfileBuilderContext context,
                                            final String nameFormat) {
        val principalId = context.getAuthenticatedAssertion().orElseThrow().getName();
        LOGGER.debug("Preparing NameID attribute for principal [{}]", principalId);
        val nameIdValue = getNameIdValueFromNameFormat(nameFormat, context);
        LOGGER.debug("NameID attribute value is set to [{}]", nameIdValue);
        return nameIdValue;
    }
Prepare name id attribute idp attribute.

@param context    the context
@param nameFormat the name format
@return the idp attribute
support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/builders/nameid/SamlProfileSamlNameIdBuilder.java