protected void buildDefaultAuthenticatingAuthority(final SamlProfileBuilderContext context,
                                                       final AuthnContext authnContext) throws Exception {
        if (!context.getRegisteredService().isSkipGeneratingAuthenticatingAuthority()) {
            val entityIdCriteriaSet = new CriteriaSet(
                new EvaluableEntityRoleEntityDescriptorCriterion(IDPSSODescriptor.DEFAULT_ELEMENT_NAME),
                new SamlIdPSamlRegisteredServiceCriterion(context.getRegisteredService()));
            LOGGER.trace("Resolving entity id from SAML2 IdP metadata for signature signing configuration is [{}]",
                context.getRegisteredService().getName());
            val entityId = Objects.requireNonNull(samlIdPMetadataResolver.resolveSingle(entityIdCriteriaSet)).getEntityID();
            LOGGER.trace("Resolved entity id from SAML2 IdP metadata is [{}]", entityId);
            val authority = newSamlObject(AuthenticatingAuthority.class);
            authority.setURI(entityId);
            authnContext.getAuthenticatingAuthorities().add(authority);
        }
    }
This is {@link SamlProfileAuthnContextClassRefBuilder}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/builders/authn/SamlProfileAuthnContextClassRefBuilder.java