Search code examples
adobe-pdfservices

pdfservices-node-sdk : can not use server to server authentication using this lib?


I am using the node library of aodbe pdf service (@adobe/pdfservices-node-sdk": "^3.3.0).

Earlier I was using Service account credentials to generate the pdf and it was working fine till few days back; but all of sudden it stopped working. I have checked the credentials/api quota and all looks fine.

I can see that they want to migrate us to server to server using Auth0; but seems like this library doesn't have any method/functions to accept credentials (without private key).

All their sample codes/documentation mentions using "PDFServicesSdk.Credentials.serviceAccountCredentialsBuilder()", but this was for older (deprecated) credentials; can't see any new method that can be called for server to server auth0 credentials?

Is any one facing the same issue?

Thanks, Kushal

All credentials and quota limit are fine.


Solution

  • it's not Auth0, but OAuth. And it's actually going to be far simpler - two credentials in your code versus 5. If you look at the updated quick starts on the docs it shows how to change your code. Basically - migrate to the new creds, and update your code to use it in the SDK.

    Now I'm stressing because I want to share links to our docs, but SO doesn't like that. Um so the core guide is here, https://developer.adobe.com/document-services/docs/overview/pdf-services-api/quickstarts/nodejs/, but here's the relevant code:

    const credentials =  PDFServicesSdk.Credentials
            .servicePrincipalCredentialsBuilder()
            .withClientId("PDF_SERVICES_CLIENT_ID")
            .withClientSecret("PDF_SERVICES_CLIENT_SECRET")
            .build();
    

    Basically, change the id and client secret.