Open olavgg opened 1 month ago
Instead of creating a file for nifi, you should be able to add a base64 encoded value
This works with the Pulsar Client
String oauth2Creds = "{" + "\"type\":\"client_credentials\"," + "\"client_id\": \"" + clientId + "\"," + "\"client_secret\": \"" + clientSecret + "\"," + "\"issuer_url\": \"" + issuerUrl + "\"" + "}"; String base64data = Base64.getEncoder().encodeToString(oauth2Creds.getBytes()); String json = "{" + "\"type\":\"client_credentials\"," + "\"privateKey\":\"data:application/json;base64," + base64data + "\"," + "\"issuerUrl\":\"" + issuerUrl + "\"," + "\"audience\":\""+audience+"\"" + "}"; var auth = AuthenticationFactory .create(AuthenticationOAuth2.class.getName(), json); client = PulsarClient.builder() .serviceUrl(myPulsarUrl) .authentication(auth) .build();
+1
Instead of creating a file for nifi, you should be able to add a base64 encoded value
This works with the Pulsar Client