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:pass@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 AI Document Intelligence
Azure AI Document Intelligence
An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
1,221 questions
0 comments No comments
{count} votes

Accepted answer
  1. romungi-MSFT 41,326 Reputation points Microsoft Employee
    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