• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Getting "The provided token is malformed or otherwise invalid"

New Here ,
Nov 17, 2022 Nov 17, 2022

Copy link to clipboard

Copied

I followed the .Net example for "ExportPdfToDocx" using the Adobe.PDFServiceSDK. 

It throw the "The provided token is malformed or otherwise invalid" when calling exportPdfOperation.Excute(executionContext).

 

Code snipple:

Credentials credentials = Credentials.ServiceAccountCredentialsBuilder()
                            .FromFile(@"..\pdfservices-api-credentials.json")
                            .Build();

            //Create an ExecutionContext using credentials and create a new operation instance.
            ExecutionContext executionContext = ExecutionContext.Create(credentials);
            ExportPDFOperation exportPdfOperation = ExportPDFOperation.CreateNew(ExportPDFTargetFormat.DOCX);

            // Set operation input from a local PDF file
            FileRef sourceFileRef = FileRef.CreateFromLocalFile(inputFile);
            exportPdfOperation.SetInput(sourceFileRef);

            // Execute the operation.
            ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
            FileRef result = exportPdfOperation.Execute(executionContext);

            // Save the result to the specified location.
            result.SaveAs(newFile);

Anyone encounter this and have solution?

TOPICS
.NET SDK

Views

585

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 01, 2023 Feb 01, 2023

Copy link to clipboard

Copied

LATEST

I have the same problem. I also follow the examples and gets "The provided token is malformed or otherwise invalid" when calling exportPdfOperation.Excute(executionContext). Anyone have a solution for this? Is seems that the token field is null in executionContext.. I have double checked all the credential values.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources