Shane Posted October 7, 2017 Share Posted October 7, 2017 I am trying to connect to the winapi using the new integrated AD authentication model however I am consistently receiving an error. [{"errors":[{"message":"Invalid API Call"},{"phrase":"Error = Object reference not set to an instance of an object.}]}] Code I am using in powershell is based off the winapi guide $PasswordstateUrl = 'https://<url>/WinAPI/searchpasswords/?username=username' Invoke-RestMethod -Uri $PasswordstateUrl -Method Get -UseDefaultCredentials The same query works with no issue when using the native api $header = @{ "APIKey" = "xxxxxxxxxxxx" } $PasswordstateUrl = 'https://<url>/api/searchpasswords/?username=username' $result = Invoke-RestMethod -Uri $PasswordstateUrl -Method Get -Headers $header I have confirmed that the application is setup correctly based on the KB article and I am able to access the winapi documentation on my instance without issue Any guidance on how best to troubleshoot? Link to comment Share on other sites More sharing options...
support Posted October 7, 2017 Share Posted October 7, 2017 Hi Shane, Sorry you're having some issues with this. To help troubleshoot this issue, can you tell me the following: What build of Passwordstate are you using? In Build 8114, we provided some better error reporting for the WinAPI And if you go to the screen Administration -> Passwordstate Administration -> System Settings -> API Tab, under the section 'Windows Integrated API Settings' is this set to Yes? If it's not, can you change it and then restart IIS Thanks Shane. Regards Click Studios Link to comment Share on other sites More sharing options...
Shane Posted October 8, 2017 Author Share Posted October 8, 2017 Thanks for the reply The build we are using is 8114. Have confirmed the setting and it was already set to Windows Integrated. Link to comment Share on other sites More sharing options...
support Posted October 8, 2017 Share Posted October 8, 2017 Thanks for confirming Shane. I think we may have found the cause of this issue. In IIS, for the WinAPI folder, can you please make sure ASP.NET Impersonation and Windows Authentication are enabled - all others should be disabled? I think when we documented the changes required in the KB article, possibly ASP.NET Impersonation was enabled by default System Wide on the dev environment we tested on, so we need to update our documentation for this. And one other thing to check is that the URL for your Passwordstate web site is being detected in the 'Local Intranet Zone' in Internet Explorer. If it isn't, this may cause issues as you may see prompting for authentication. Can you let us know if this helps? Regards Click Studios Link to comment Share on other sites More sharing options...
Shane Posted October 8, 2017 Author Share Posted October 8, 2017 Fantastic. Looks like Anonymous Authentication was enable on the application. All others were set correctly. After disabling I am now able to query the winapi without issue. Thanks for your help! Link to comment Share on other sites More sharing options...
support Posted October 8, 2017 Share Posted October 8, 2017 Excellent - thanks Shane. We'll update our documentation a bit more to show a screen of what should be set. Regards Click Studios Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.