code: public static String generateRequestId() {
          /* compute a random 256-bit string and hex-encode it */
          final SecureRandom sr = new SecureRandom();
          final byte[] bytes = new byte[32];
          sr.nextBytes(bytes);
          return hexEncode(bytes);
      }
docs: Generate a request ID suitable for passing to
  SAMLClient.createAuthnRequest.