E9.2 Connecting Orchestrator to Google PubSub

tboat00

tboat00

Well Known Member
I am wondering if anyone has any experience connecting orchestrator to Google PubSub. We have a new project integrating a cloud-based warehouse management system that uses Google PubSub as its messaging conduit. They have generated all of our authentication information for us, but I am not sure what I need to do to set up the OAUTH2 connector using a private key on our tools release level 9.2.5.4.

If any one has any insight or can lead me to the documentation to support this connection, I would appreciate the help. I am seen the documents on Oracle support, but I am still not clear on the connection setup details.
 
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 :D ). 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
1711117321707.png

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.*:
1711117481048.png

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
 
Back
Top