Skip to main content
Participating Frequently
July 23, 2022
Answered

Storing Extract API Credentials Securely in Azure

  • July 23, 2022
  • 2 replies
  • 635 views

I've been using the extract api locally (really enjoying it) but now I'm read to publish to the server.  How should I go about storing the "pdfservices-api-credentials.json" and "private.key" files securely?  My first thought was keyvault, but I don't see any options for storing json or .key file types...  Has anyone done this? 

 

Thank you!

This topic has been closed for replies.
Correct answer Ben Vanderberg

To add to @Raymond Camden 's comment,

In the sample code there is an example that has those parameters:

Credentials credentials = Credentials.serviceAccountCredentialsBuilder()
                    .withClientId("CLIENT_ID")
                    .withClientSecret("CLIENT_SECRET")
                    .withPrivateKey("PRIVATE_KEY_FILE_CONTENTS")
                    .withOrganizationId("ORGANIZATION_ID")
                    .withAccountId("ACCOUNT_ID")
                    .build();

https://github.com/adobe/pdfservices-java-sdk-samples/blob/master/src/main/java/com/adobe/pdfservices/operation/samples/createpdf/CreatePDFWithInMemoryAuthCredentials.java 

2 replies

Ben Vanderberg
Community Manager
Ben VanderbergCommunity ManagerCorrect answer
Community Manager
July 25, 2022

To add to @Raymond Camden 's comment,

In the sample code there is an example that has those parameters:

Credentials credentials = Credentials.serviceAccountCredentialsBuilder()
                    .withClientId("CLIENT_ID")
                    .withClientSecret("CLIENT_SECRET")
                    .withPrivateKey("PRIVATE_KEY_FILE_CONTENTS")
                    .withOrganizationId("ORGANIZATION_ID")
                    .withAccountId("ACCOUNT_ID")
                    .build();

https://github.com/adobe/pdfservices-java-sdk-samples/blob/master/src/main/java/com/adobe/pdfservices/operation/samples/createpdf/CreatePDFWithInMemoryAuthCredentials.java 

Raymond Camden
Community Manager
Community Manager
July 25, 2022

All our SDKs support providing credentials via methods, like .clientId(...) (going by memory here, that's not the exact caall). So in production you would put the values in environment variables and pass them to our code that way.

 

See Python ref here: https://opensource.adobe.com/pdfservices-python-sdk-samples/apidocs/latest/reference/index.html#serviceaccountcredentials