West Wind Internet and Client Tools
Use JSONServiceClient with NTLM Authentication
Gravatar is a globally recognized avatar based on your email address. Use JSONServiceClient with NTLM Authentication
  Steve Howie
  All
  Aug 31, 2023 @ 08:10am

Hi there, I've been testing some API setups with Postman and am ready to start moving into VFP. However, I just realized that our API uses NTLM Authentication, which Postman supports, but I don't see how to integrate that into JsonServiceClient. When I try running a simple call with callservice, I get an empty string back. Any ideas on how this could best be accomplished?

Thanks in advance!

Gravatar is a globally recognized avatar based on your email address. re: Use JSONServiceClient with NTLM Authentication
  Steve Howie
  Steve Howie
  Aug 31, 2023 @ 01:03pm

You can disregard this post. I dug around in my past VirtualFox docs and found that httpget will let me pass username/password. This is working - I'll figure out how to post and pass a json object next.

Gravatar is a globally recognized avatar based on your email address. re: Use JSONServiceClient with NTLM Authentication
  Rick Strahl
  Steve Howie
  Aug 31, 2023 @ 01:40pm

You can use the JsonServiceClient.Createwwhttp() to create the HTTP instance with username and password and pass it to that method, then use the service client as before. IOW, you can pre-configure the HTTP object instance. Alternately that method creates a default instance and returns it so you can set user name and password on it.

loClient = CREATEOBJECT("wwJsonServiceClient")
loHttp = loClient.CreatewwHttp()
loHttp.cUsername = "me"
loHttp.cPassword = "superSeekrit"
...
loHttp.CallService(lcUrl, loData, "POST")

+++ Rick ---

© 1996-2024