Logout

Alt-N Discussion Groups > MDaemon Discussion Groups > MDaemon API > XML API broken with 19.5.1?

 [F] Alt-N Discussion Groups  / MDaemon Discussion Groups  / MDaemon API  /

XML API broken with 19.5.1?

[nils.petersen@psyma.com]
nils.petersen@p…
Novice
Novice
Posts: 147
nils.petersen@psyma.com - 09:25am, Nov 13 2019

(reposting from mdbeta)

As it seems, the update from 19.5.0 to 19.5.1 broke the XML API.

We're using various automating functions (GetDomainList, GetUserInfo, SetDynamicScreen) and all of them just return an empty string.
Nothing shows up in the detail logs in \MDaemon\Logs\MdMgmtSW\ either.

Anyone using XML API and got it still working?

This PHP snippet used to work with 19.5.0:
define('MDAPIURL', 'https://mdlogtracker:xxxxxxxxxx@mail.psyma.com:3002/MdMgmtWS');

    $xml=
    '<?xml version="1.0" encoding="utf-8"?>
    <MDaemon>
        <API>
            <Request version="19.5.0" echo="1" verbose="1">
                <Operation>GetDomainList</Operation>
                <Parameters>
                    <Get>
                        <Users/>
                    </Get>
                </Parameters>
            </Request>
        </API>
    </MDaemon>';

    $ch = curl_init(MDAPIURL);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    $response = curl_exec($ch);
    var_dump($response);
    curl_close($ch);

Regards
Nils



--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------

  All MessagesOldest ItemsOlder ItemsNewer ItemsNewest Items

Keith Personett (apparently) - Nov 13, 2019 9:40 am (#1 Total: 13)  

via email  

Photo of Author
Keith Personett
Newbie
Newbie
Posts: 76

Nils,

 

What does the Logfile show?

 

Is Authentication succeeding? This sounds related to the authentication issue that we just implemented a fix for, where the client was not correctly sending the domain in the auth info…

 

Keith Personett

Senior Software Developer, Cerebro Calibration Specialist, Agent of S.H.I.E.LD., Helicarrier Systems Analyst

MDaemon Technologies http://www.mdaemon.com/ or on Facebook

Sent using Outlook 2013 via ActiveSync Services for MDaemon Messaging Server.

I 16 1018

"You get hurt, hurt 'em back. You get killed... walk it off!"

                - Steve Rogers/Captain America


--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------

nils.petersen@psyma.com (apparently) - Nov 14, 2019 7:53 am (#2 Total: 13)  

via email  

Photo of Author
nils.petersen@p…
Novice
Novice
Posts: 147
Hi Keith,

On 13.11.2019 15:40, Keith Personett wrote:
What does the Logfile show?

which logfile do you mean? The MdMgmtWS-yyyy-mm-dd.log is empty apart from the rotation entries and has always been.

The DynScrn-yyyy-mm-dd.log used to show API usage entries like
191101 000100464 I [14A1715C] 0x41504000 Mgmt Logon: 172.16.9.110 [mdlogtracker@psyma.com] (MAIL1:mdmgmtws.dll:0B0C:079c)
191101 000100474 I [14A1715C] 0x4150400D Mgmt Add: Black Item: IP:95.211.209.158 (MDlogtracker SMTP pattern)
191101 000100482 I [14A1715C] 0x41504002 Mgmt Logoff: 172.16.9.110 [mdlogtracker@psyma.com]
but there's nothing like that any more since 19.5.1 was installed.

In \MDaemon\Logs\MdMgmtWS\ nothing shows up any more either - even failed requests used to be logged there.

Is Authentication succeeding?


I can't tell. Regardless of what I throw at the API it just returns an empty string, see the sample code. Unless authentication has been changed for the XML API it looks AOK to me.
HTTPS or HTTP doesn't make a difference either (to the configured RemoteAdmin ports 3002 or 3001 respectively).

This sounds related to the authentication issue that we just implemented a fix for, where the client was not correctly sending the domain in the auth info…


I think that's for ActiveSync - did anything else change as well?

Can you verify if the XML API works at all with 19.5.1, any which way? In the way our PHP script calls it? Is there any other way to do it?

Best!
Nils

--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------

Keith Personett (apparently) - Nov 14, 2019 8:54 am (#3 Total: 13)  

via email  

Photo of Author
Keith Personett
Newbie
Newbie
Posts: 76

As far as the logging… Ensure that the following are set in MgmtWS.ini in the Data directory

 

[Logs]

LogHasDeviceIdEntries=No

LogHasDeviceTypeEntries=No

LogHasOperationEntries=Yes

LogHasUserEntries=Yes

LogLevel=1

 

NP>> I think that's for ActiveSync - did anything else change as well?

 

That change affected 4 ISAPI modules, MdMgmtWS, MdAirSync, MdAutoDiscover and Mddp

 

Easiest way to verify that the API is being loaded and functioning is to just bring up the help portal by opening your browser and navigate to http[s]/{ServerName}:{Port}/{EntryUrl}

( on my main test server, for instance, https://marvel.int:444/API )

 

I don’t have a way to test php code… I generally test with Javascript, Powershell and C++. All of my tests with 19.5.0, 19.5.1 and 19.5.2 (internal) succeed.

 

Keith Personett

Senior Software Developer, Cerebro Calibration Specialist, Agent of S.H.I.E.LD., Helicarrier Systems Analyst

MDaemon Technologies http://www.mdaemon.com/ or on Facebook

Sent using Outlook 2013 via ActiveSync Services for MDaemon Messaging Server.

I 16 1018

"You get hurt, hurt 'em back. You get killed... walk it off!"

                - Steve Rogers/Captain America


--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------

Keith Personett (apparently) - Nov 14, 2019 9:10 am (#4 Total: 13)  

via email  

Photo of Author
Keith Personett
Newbie
Newbie
Posts: 76

Nils,

 

This line….

 

define('MDAPIURL', 'https://{Username}:{Password}@{ServerName}:{Port}/{EntryPoint}');

It appears that you are not sending the domain for the account. Is this account in the primary domain? Do you have full email required for logon set?

 

What if you change that define to …

 

define('MDAPIURL', 'https://{Username}@{domain}:{Password}@{ServerName}:{Port}/{EntryPoint}');

 

How does that affect things?

 

In my test scripts, I build the http-authorization buffer by base64 encoding it myself and adding the http-authorization header manually. This avoids the need for the XmlHttpRequest object to receive a 401 and then send credentials on a second request. I hate the logs being polluted with all of the 401’d requests.

 

Keith Personett

Senior Software Developer, Cerebro Calibration Specialist, Agent of S.H.I.E.LD., Helicarrier Systems Analyst

MDaemon Technologies http://www.mdaemon.com/ or on Facebook

Sent using Outlook 2013 via ActiveSync Services for MDaemon Messaging Server.

I 16 1018

"You get hurt, hurt 'em back. You get killed... walk it off!"

                - Steve Rogers/Captain America


--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------

nils.petersen@psyma.com (apparently) - Nov 19, 2019 5:29 am (#5 Total: 13)  

via email  

Photo of Author
nils.petersen@p…
Novice
Novice
Posts: 147
On 14.11.2019 14:54, Keith Personett wrote:

As far as the logging… Ensure that the following are set in MgmtWS.ini in the Data directory

 

[Logs]

LogHasDeviceIdEntries=No

LogHasDeviceTypeEntries=No

LogHasOperationEntries=Yes

LogHasUserEntries=Yes

LogLevel=1


Looks OK - these are the entries here:
[Logs]
HasDeviceIdEntries=No
HasDeviceTypeEntries=No
HasOperationEntries=Yes
HasUserEntries=Yes
LatestLogFile=D:\MDAEMON\LOGS\MdMgmtWS-2019-10-21.log
LogFilePrefix=MdMgmtWS
LogHasDeviceIdEntries=No
LogHasDeviceTypeEntries=No
LogHasOperationEntries=Yes
LogHasUserEntries=Yes
LogLevel=5

The leading lines Has... are legacy entries?

NP>> I think that's for ActiveSync - did anything else change as well?

 

That change affected 4 ISAPI modules, MdMgmtWS, MdAirSync, MdAutoDiscover and Mddp

 

Easiest way to verify that the API is being loaded and functioning is to just bring up the help portal by opening your browser and navigate to http[s]/{ServerName}:{Port}/{EntryUrl}

( on my main test server, for instance, https://marvel.int:444/API )


Seems that's the problem - loading https://mail.psyma.com:3002/API just results in

Not Found


Loading https://mail.psyma.com:3002/MdMgmtWS?Operation=Help does work btw.

I think I've mentioned that I tried reinstalling 19.5.1 on top (suspecting something of the kind), but that didn't change anything.

I don’t have a way to test php code… I generally test with Javascript, Powershell and C++. All of my tests with 19.5.0, 19.5.1 and 19.5.2 (internal) succeed.


You could just download and extract the current PHP 7.3 package for Windows, uncomment the line in php.ini
extension=php_curl.dll
and php snippet.php should run the script snippet.

Can you call the XML API on 19.5.1 with anything and get a result? Do you have any test code I can run here?

Best!
Nils

--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------

nils.petersen@psyma.com (apparently) - Nov 19, 2019 6:07 am (#6 Total: 13)  

via email  

Photo of Author
nils.petersen@p…
Novice
Novice
Posts: 147
Hi Keith,

On 14.11.2019 15:10, Keith Personett wrote:
This line….

 

define('MDAPIURL', 'https://{Username}:{Password}@{ServerName}:{Port}/{EntryPoint}');

It appears that you are not sending the domain for the account. Is this account in the primary domain? Do you have full email required for logon set?


Duh - you are absolutely correct, the @mail.psyma.com bit made me miss the domain... :-[

We used to have full address for logon not (yet) set but I've changed that when trying to get the XML API working again. We shouldn't depend on the default domain anyway and planned to force full address anyway.
 

What if you change that define to …

 

define('MDAPIURL', 'https://{Username}@{domain}:{Password}@{ServerName}:{Port}/{EntryPoint}');

 

How does that affect things?


Hmm - the double '@' throws connection failures now at least ('can't find host psyma.com@password:mail.psyma.com')...

Trying the alternative logon delimiter '$' now [...] - and back to start... API returns an empty string again, nothing in the log, no XML in MdMgmtWS/ either.
Shouldn't authentication failures show up somewhere?

In my test scripts, I build the http-authorization buffer by base64 encoding it myself and adding the http-authorization header manually. This avoids the need for the XmlHttpRequest object to receive a 401 and then send credentials on a second request. I hate the logs being polluted with all of the 401’d requests.


I wasn't getting those 401s here using PHP, so I thought it was fine passing the logon on the URL.
[...]
I've changed the URL-inline authentication to using CURLOPT_USERNAME and CURLOPT_USERPWD - but still, no change.

Could you send me a known-good Powershell snippet or an .exe I could try with? I'm pretty sure now that our installation is borked somehow.

Best
Nils

--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------

Keith Personett (apparently) - Nov 19, 2019 8:23 am (#7 Total: 13)  

via email  

Photo of Author
Keith Personett
Newbie
Newbie
Posts: 76

Nils,

 

Just coming back from some time off, so I have some catching up to do.

 

If you look in the ‘{MDaemon}\Docs\API\XML API\Samples’ directory, you will see how I do this in JScript. The .js file, common.js is included by the wsf examples files for testing via a command line under Windows. Look at the PostData and BuildAuth functions. It is used by the .wsf file examples, such as the ‘DSWhiteListReport.wsf’ example.

 

There are a few PowerShell examples there also, such as ASReportDevices.ps1 that you can look at.


--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------

Keith Personett (apparently) - Nov 19, 2019 8:31 am (#8 Total: 13)  

via email  

Photo of Author
Keith Personett
Newbie
Newbie
Posts: 76

NP>> Trying the alternative logon delimiter '$' now [...] - and back to start... API returns an empty string again, nothing in the log, no XML in MdMgmtWS/ either.
NP>> Shouldn't authentication failures show up somewhere?

The With Info or Debug logging, the XmlApi logs every connection is receives from the ISAPI Host process, so if it is not showing anything in the log, the XMLAPI module is never even being called by the ISAPI Host Process (WorldClient.exe, w3wp.exe, whatever is running that service…).

 

When I get some time, I will look into the php module you referred me to.


--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------

nils.petersen@psyma.com (apparently) - Nov 20, 2019 11:58 am (#9 Total: 13)  

via email  

Photo of Author
nils.petersen@p…
Novice
Novice
Posts: 147
On 19.11.2019 14:31, Keith Personett wrote:

NP>> Trying the alternative logon delimiter '$' now [...] - and back to start... API returns an empty string again, nothing in the log, no XML in MdMgmtWS/ either.
NP>> Shouldn't authentication failures show up somewhere?

The With Info or Debug logging, the XmlApi logs every connection is receives from the ISAPI Host process, so if it is not showing anything in the log, the XMLAPI module is never even being called by the ISAPI Host Process (WorldClient.exe, w3wp.exe, whatever is running that service…).

 

When I get some time, I will look into the php module you referred me to.


Now we're getting somewhere: I've got DSWhiteListReport.ps1 working - it also required
$Url = "https://mail.psyma.com:3002/MdMgmtWS"

If the /API bit is supposed to be a placeholder I didn't get it...

So obviously, the PHP call doesn't work any more, very likely due to the authentication changes that happened in 19.5.1.

I've traced the actual HTTP call from PHP using Wireshark and noticed that the CURLOPT_USERNAME doesn't appear to have any effect. The value isn't passed to the server and the call fails with a 401 - without being logged anywhere. (I guess CURLOPT_USERNAME is only used with some login methods, but that's poorly documented...)
I didn't really want to dive into the subtleties of PHP and cURL, so I just tried the CURLOPT_USERPWD to pass username@domain.tld:password - and that works!

YAY!

Thanks for your help, Keith. It seems, the API logging needs some fixing for authentication failures but all the rest was due to URL authentication not working any more and PHP/cURL header authenticaton not understood by me.

Best!
Nils

--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------


--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------

Keith Personett (apparently) - Nov 20, 2019 12:04 pm (#10 Total: 13)  

via email  

Photo of Author
Keith Personett
Newbie
Newbie
Posts: 76

WOOHOO!

 

I’ll look into the logging, but I believe that in those cases where you were not seeing log entries, it was likely hitting the wrong URL, so the xmlapi was never called. Which means it never had anything to log.

 

We learn new things every day… J

 

Keith Personett

Senior Software Developer, Cerebro Calibration Specialist, Agent of S.H.I.E.LD., Helicarrier Systems Analyst

MDaemon Technologies http://www.mdaemon.com/ or on Facebook

Sent using Outlook 2013 via ActiveSync Services for MDaemon Messaging Server.

I 16 1018

"You get hurt, hurt 'em back. You get killed... walk it off!"

                - Steve Rogers/Captain America

 

From: md-api@mdaemon.com [mailto:md-api@mdaemon.com] On Behalf Of Nils Petersen (nils.petersen@psyma.com)
Sent: Wednesday, November 20, 2019 10:59 AM
To: md-api List Member <md-api@mdaemon.com>
Subject: [md-api] XML API broken with 19.5.1?

 

On 19.11.2019 14:31, Keith Personett wrote:

NP>> Trying the alternative logon delimiter '$' now [...] - and back to start... API returns an empty string again, nothing in the log, no XML in MdMgmtWS/ either.
NP>> Shouldn't authentication failures show up somewhere?


The With Info or Debug logging, the XmlApi logs every connection is receives from the ISAPI Host process, so if it is not showing anything in the log, the XMLAPI module is never even being called by the ISAPI Host Process (WorldClient.exe, w3wp.exe, whatever is running that service…).

 

When I get some time, I will look into the php module you referred me to.


Now we're getting somewhere: I've got DSWhiteListReport.ps1 working - it also required

$Url = "https://mail.psyma.com:3002/MdMgmtWS"


If the /API bit is supposed to be a placeholder I didn't get it...

So obviously, the PHP call doesn't work any more, very likely due to the authentication changes that happened in 19.5.1.

I've traced the actual HTTP call from PHP using Wireshark and noticed that the CURLOPT_USERNAME doesn't appear to have any effect. The value isn't passed to the server and the call fails with a 401 - without being logged anywhere. (I guess CURLOPT_USERNAME is only used with some login methods, but that's poorly documented...)
I didn't really want to dive into the subtleties of PHP and cURL, so I just tried the CURLOPT_USERPWD to pass username@domain.tld:password - and that works!

YAY!

Thanks for your help, Keith. It seems, the API logging needs some fixing for authentication failures but all the rest was due to URL authentication not working any more and PHP/cURL header authenticaton not understood by me.

Best!
Nils


--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------
 
---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------

 

 
 
--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------
 
---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------

--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------

nils.petersen@psyma.com (apparently) - Nov 21, 2019 3:08 am (#11 Total: 13)  

via email  

Photo of Author
nils.petersen@p…
Novice
Novice
Posts: 147
On 20.11.2019 18:04, Keith Personett wrote:

I’ll look into the logging, but I believe that in those cases where you were not seeing log entries, it was likely hitting the wrong URL, so the xmlapi was never called. Which means it never had anything to log.


Actually, the API stopped working and the log stopped showing anything simultaneously after the 19.5.1 update. Only later I tried the samples with the wrong URL - shouldn't that show up somewhere as well, like in WDaemon.log or so?

Best
Nils

From: md-api@mdaemon.com [mailto:md-api@mdaemon.com] On Behalf Of Nils Petersen (nils.petersen@psyma.com)
Sent: Wednesday, November 20, 2019 10:59 AM
To: md-api List Member <md-api@mdaemon.com>
Subject: [md-api] XML API broken with 19.5.1?

 

On 19.11.2019 14:31, Keith Personett wrote:

NP>> Trying the alternative logon delimiter '$' now [...] - and back to start... API returns an empty string again, nothing in the log, no XML in MdMgmtWS/ either.
NP>> Shouldn't authentication failures show up somewhere?


The With Info or Debug logging, the XmlApi logs every connection is receives from the ISAPI Host process, so if it is not showing anything in the log, the XMLAPI module is never even being called by the ISAPI Host Process (WorldClient.exe, w3wp.exe, whatever is running that service…).

 

When I get some time, I will look into the php module you referred me to.


Now we're getting somewhere: I've got DSWhiteListReport.ps1 working - it also required

$Url = "https://mail.psyma.com:3002/MdMgmtWS"


If the /API bit is supposed to be a placeholder I didn't get it...

So obviously, the PHP call doesn't work any more, very likely due to the authentication changes that happened in 19.5.1.

I've traced the actual HTTP call from PHP using Wireshark and noticed that the CURLOPT_USERNAME doesn't appear to have any effect. The value isn't passed to the server and the call fails with a 401 - without being logged anywhere. (I guess CURLOPT_USERNAME is only used with some login methods, but that's poorly documented...)
I didn't really want to dive into the subtleties of PHP and cURL, so I just tried the CURLOPT_USERPWD to pass username@domain.tld:password - and that works!

YAY!

Thanks for your help, Keith. It seems, the API logging needs some fixing for authentication failures but all the rest was due to URL authentication not working any more and PHP/cURL header authenticaton not understood by me.

Best!
Nils


--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------
 
---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------

 

 
 
--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------
 
---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------
--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------


--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------

Keith Personett (apparently) - Nov 21, 2019 11:30 am (#12 Total: 13)  

via email  

Photo of Author
Keith Personett
Newbie
Newbie
Posts: 76

The API likely stopped working due to the authentication fix combined with a lack of proper credentials.

 

I would expect that the 404 from the wrong URL would typically show up in the WDaemon log, but that is not one of the modules I work on primarily, so I am not sure about which log it would go to.

 

Keith Personett

Senior Software Developer, Cerebro Calibration Specialist, Agent of S.H.I.E.LD., Helicarrier Systems Analyst

MDaemon Technologies http://www.mdaemon.com/ or on Facebook

Sent using Outlook 2013 via ActiveSync Services for MDaemon Messaging Server.

I 16 1018

"You get hurt, hurt 'em back. You get killed... walk it off!"

                - Steve Rogers/Captain America


--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------

nils.petersen@psyma.com (apparently) - Nov 22, 2019 6:17 am (#13 Total: 13)  

via email  

Photo of Author
nils.petersen@p…
Novice
Novice
Posts: 147
On 21.11.2019 17:30, Keith Personett wrote:

The API likely stopped working due to the authentication fix combined with a lack of proper credentials.

 

I would expect that the 404 from the wrong URL would typically show up in the WDaemon log, but that is not one of the modules I work on primarily, so I am not sure about which log it would go to.


WDaemon.log shows a bunch of AS errors with the update,
Tue 2019-11-05 20:37:07.476: Could not initialize ISAPI DLL d:\mdaemon\worldclient\html\mdairsync.dll
(I rebooted the server after the update and that error vanished)
but there's nothing related with the XML API, neither with 19.5.0 (where it was still working) nor with 19.5.1 (where it stopped).

Hmm...
Nils

--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------



  All MessagesOldest ItemsOlder ItemsNewer ItemsNewest Items



 Content:

Read New | Search

 Guest:

Email to Admin



You are visiting as a Guest user.