private String getNameIdValueFromNameFormat(final String nameFormat,
                                                final SamlProfileBuilderContext context) {
        val principalId = context.getAuthenticatedAssertion().orElseThrow().getName();
        if (NameIDType.TRANSIENT.equalsIgnoreCase(StringUtils.trim(nameFormat))) {
            val entityId = context.getAdaptor().getEntityId();
            if (context.getRegisteredService().isSkipGeneratingTransientNameId()) {
                LOGGER.debug("Generation of transient NameID value is skipped for [{}] and [{}] will be used instead", entityId, principalId);
            } else {
                LOGGER.debug("Generating transient NameID value for principal [{}] and entity id [{}]", principalId, entityId);
                return persistentIdGenerator.generate(principalId, entityId);
            }
        }
        return principalId;
    }
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