@SuppressWarnings("unchecked")
    protected final LogoutResponse buildLogoutResponse(final SAML2MessageContext context,
                                                      final Endpoint ssoService) {

        val builder = (SAMLObjectBuilder<LogoutResponse>) this.builderFactory
            .getBuilder(LogoutResponse.DEFAULT_ELEMENT_NAME);
        val response = builder.buildObject();

        val selfContext = context.getSAMLSelfEntityContext();

        response.setID(SAML2Utils.generateID());
        response.setIssuer(getIssuer(selfContext.getEntityId()));
        response.setIssueInstant(Instant.now().plusSeconds(this.issueInstantSkewSeconds));
        response.setVersion(SAMLVersion.VERSION_20);
        response.setDestination(ssoService.getLocation());
        response.setStatus(getSuccess());
        val originalMessage = (SAMLObject) context.getMessageContext().getMessage();
        if (originalMessage instanceof RequestAbstractTypeImpl) {
            response.setInResponseTo(((RequestAbstractTypeImpl) originalMessage).getID());
        }

        return response;
    }
<p>buildLogoutResponse.</p>

@param context a {@link SAML2MessageContext} object
@param ssoService a {@link org.opensaml.saml.saml2.metadata.SingleLogoutService} object
@return a {@link LogoutResponse} object
pac4j-saml/src/main/java/org/pac4j/saml/logout/impl/SAML2LogoutResponseBuilder.java