Share via

Document Intelligence reading PDF - Problem with http authentication

Daniel 20 Reputation points
2023-07-28T13:20:20.6+00:00

I'm reading a public available PDF with curl using the FormRecognizer.

curl -i -X POST "%FR_ENDPOINT%formrecognizer/documentModels/{modelID}:analyze?api-version=2022-08-31" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: %FR_KEY%" --data-ascii "{'urlSource': '{document-url}'}"

That works well.

Now I have a PDF with HTTP basic authentication. I've tried to pass the user and pass in the document-url (f.e. https://user:******@www.url.com/mypdf.pdf) but that fails with:

[ms-azure-ai-errorcode] => InvalidRequest

Does anyone have an idea how I can pass the credentials so it works?

Thanks for your help.

Azure Document Intelligence in Foundry Tools
0 comments No comments

Answer accepted by question author
  1. Rohit Mungi 49,126 Reputation points Microsoft Employee Moderator
    2023-07-31T08:27:04.56+00:00

    @Daniel Azure Document intelligence or Form recognizer cannot read files which are password authenticated. As a requirement PDF file should have the password removed before passing it to the service. Thanks!!

    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.