Oooh this is one we've had to learn via trial and error because the documentation is a bit spotty (as you'll hear from our counterparts shortly I'm sure
). I don't have experience with Google pubsub specifically so YMMV with this post.
You are using oauth2 private key... does this mean PKCE flow including generating the request token?
If you are NOT and the private key is a "client ID" / secret pair, then you can do it from the security tab of the connection
If you ARE and need to generate a JWT to get your access/refresh token, then you need to get a bit.... more involved.
Here's how I'm doing it for DocuSign, and this worked when we were 9.2.5.*:
The scripting in step 2 is the hard part. I ended up having to work with CNC to install additional javalibs on the servers. The script is somewhat a company secret so I won't share it out, but I'll share out the import section to give you an idea of what I had to add in to get everything working.
JavaScript:
import com.oracle.e1.common.OrchestrationAttributes;
import java.text.SimpleDateFormat;
import static java.nio.charset.StandardCharsets.UTF_8;
import java.security.KeyFactory;
import java.security.Signature;
import java.security.interfaces.*;
import java.security.spec.EncodedKeySpec
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.Base64;
import com.auth0.jwt.JWT;
import com.auth0.jwt.JWTCreator;
import com.auth0.jwt.algorithms.Algorithm;
import com.auth0.jwt.exceptions.JWTCreationException;
import java.security.PrivateKey;
import java.security.*;
Here are the URLs I needed to arrive at the solution as well.
Code:
// https://stackoverflow.com/questions/45189859/java-simpledateformat-formatter-to-return-epoch-time-with-milliseconds
// https://stackoverflow.com/questions/1459656/how-to-get-the-current-time-in-yyyy-mm-dd-hhmisec-millisecond-format-in-java
// https://blog.mrhaki.com/2018/06/groovy-goodness-base64-url-and-filename.html
// https://www.quickprogrammingtips.com/java/how-to-create-sha256-rsa-signature-using-java.html
// https://groovyconsole.appspot.com/script/5127435238506496
// https://groovy-lang.org/syntax.html#_triple_double_quoted_string
// https://github.com/auth0/java-jwt/blob/master/README.md#available-algorithms
// https://jwt.io/libraries
// https://www.cryptool.org/en/cto/openssl
// https://stackoverflow.com/questions/29412354/rsa-public-and-private-key-as-string-variables-in-java
// https://github.com/docusign/docusign-esign-java-client/blob/5dc8c9106e03e4b5e2ba797af300c9aee18417d9/src/main/java/com/docusign/esign/client/auth/JWTUtils.java
Hope this is a bit helpful