AnsweredAssumed Answered

Authentication with Microsoft Dynamics CRM

Question asked by jbardwell on Feb 14, 2018
Latest reply on Mar 2, 2018 by jbrown

Wondering if anyone has used FileMaker to connect to Microsoft Dynamics. From various documentation I've set up test using Insert from URL script step with (I've obscured specific authentication information for posting):

URL: "https://login.microsoftonline.com/<ObscuredForPosting>/oauth2/token"

cURL options:

-X POST

--Header "Content-Type: application/x-www-form-urlencoded"

--Header "Content-Length: 230"

--Data-raw client_id=<ObscuredForPosting>&resource=https://test###.crm.dynamics.com&username=admin@#####.onmicrosoft.com&password=####&grant_type=password&client_secret=####=

--show-error

--dump-header $dump

--trace $trace

 

Request is successful when using Postman. But returns error in FM: Connection failed. I don't see anything in $trace that provides clue. $dump =

HTTP/1.1 411 Length Required

Content-Type: text/html; charset=us-ascii

Server: Microsoft-HTTPAPI/2.0

Date: Wed, 14 Feb 2018 17:06:50 GMT

Connection: close

Content-Length: 344

411 error refers to 'content-length'.

Request is supposed to return a bearer token for client_id, username, password, and client_secret provided.

Various attempts to resolve/calculate 'content-length' have returned same error.

Hopeful someone in community has experience to see what I'm missing or point me to documentation.

TIA

Outcomes