code: protected void finalizeEncode(final RequestAbstractType authnRequest,
                                    final BaseSAML2MessageEncoder encoder,
                                    final T samlResponse,
                                    final String relayState) throws Exception {
          encoder.initialize();
          encoder.encode();
      }
docs: Finalize encode response.
  
  @param authnRequest the authn request
  @param encoder      the encoder
  @param samlResponse the saml response
  @param relayState   the relay stateSurrogateAuthenticationPostProcessor.java
  @throws Exception the saml exception