@Override
    public void write(final XMLStreamWriter writer,
                      final Principal principal,
                      final WSFederationRegisteredService service) {
        val attributes = principal.getAttributes();
        LOGGER.debug("Mapping principal attributes [{}] to claims for service [{}]", attributes, service);

        attributes.forEach(Unchecked.biConsumer((name, value) -> {
            val claimName = ProtocolAttributeEncoder.decodeAttribute(name);
            if (WSFederationClaims.contains(claimName)) {
                val uri = WSFederationClaims.valueOf(name).getUri();
                LOGGER.debug("Requested claim [{}] mapped to [{}]", name, uri);
                writeAttributeValue(writer, uri, value, service);
            } else if (WSFederationClaims.containsUri(claimName)) {
                LOGGER.debug("Requested claim [{}] directly mapped to [{}]", name, claimName);
                writeAttributeValue(writer, claimName, value, service);
            } else if (customClaims.contains(claimName)) {
                LOGGER.debug("Requested custom claim [{}]", claimName);
                writeAttributeValue(writer, claimName, value, service);
            } else {
                LOGGER.debug("Requested claim [{}] is not defined/supported by CAS", claimName);
                writeAttributeValue(writer, WSFederationConstants.getClaimInCasNamespace(claimName), value, service);
            }
        }));
    }
This is {@link DefaultWSFederationRelyingPartyAttributeWriter}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-ws-idp/src/main/java/org/apereo/cas/ws/idp/services/DefaultWSFederationRelyingPartyAttributeWriter.java