private String determineNameIdForQuery(final AttributeQuery query,
                                           final SamlRegisteredService registeredService,
                                           final SamlRegisteredServiceMetadataAdaptor facade) {
        return query.getSubject().getNameID() == null
            ? getConfigurationContext().getSamlObjectEncrypter().decode(
            query.getSubject().getEncryptedID(), registeredService, facade).getValue()
            : query.getSubject().getNameID().getValue();

    }
Handle post request.

@param response the response
@param request  the request
@throws Exception the exception
support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/query/SamlIdPSaml2AttributeQueryProfileHandlerController.java