@Override
    public AttributeStatement build(final SamlProfileBuilderContext context) throws Exception {
        val attributes = new HashMap<>(context.getAuthenticatedAssertion().orElseThrow().getAttributes());
        val webApplicationService = serviceFactory.createService(context.getAdaptor().getEntityId(), WebApplicationService.class);
        val encodedAttrs = ProtocolAttributeEncoder.decodeAttributes(attributes, context.getRegisteredService(), webApplicationService);

        val attrBuilder = new SamlProfileSamlRegisteredServiceAttributeBuilder(
            context.getRegisteredService(), context.getAdaptor(), samlObjectEncrypter);
        return newAttributeStatement(context, encodedAttrs, attrBuilder);
    }
This is {@link SamlProfileSamlAttributeStatementBuilder}.

@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/attr/SamlProfileSamlAttributeStatementBuilder.java