Wireless Access

last person joined: 9 hours ago 

Access network design for branch, remote, outdoor, and campus locations with HPE Aruba Networking access points and mobility controllers.
Expand all | Collapse all

Aruba 3200 (US) Mob Cntrlr w 8 AP Bndl - inquiry for XML module on Aruba WLAN controllers

This thread has been viewed 0 times
  • 1.  Aruba 3200 (US) Mob Cntrlr w 8 AP Bndl - inquiry for XML module on Aruba WLAN controllers

    Posted Nov 07, 2016 11:07 AM

    My Aruba controller has been configured to be accessed via XML API.  I am using a PHP script to get data from the controller via XML API.

     

    I am referring this document to create my xml api request. 

    http://www.arubanetworks.com/techdocs/ArubaOS_63_Web_Help/Content/ArubaFrameStyles/XML_API/Using_the_XML_API_Server.htm

     

    As per the document, I have created my request as follows: ---- But I am getting “504 Gateway timed out” error. Can you please validate my API request and please help me to troubleshoot the issue.

     

    https://<controller-ip/auth/command.xml

     

    $xml='<aruba command="user_query"> <macaddr>xx:xx:xx:xx:xx:xx</macaddr> <key>Key generated while setting up the controller

    for XML API</key>

    <version>1.0</version> </aruba>';

     

        // Initialize cURL

                           $curl = curl_init();

                           $url = "https://<controller-ip/auth/command.xml";

                          // set URL and other appropriate options

                           curl_setopt($curl, CURLOPT_URL, $url);

                           curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/xml','Authorization: Bearer XML API key generated while setting up XML API));

                           curl_setopt($curl, CURLOPT_HEADER, 1);

                           curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);

                           curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);

                           curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);

                           curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE);

                           // This sets the number of fields to post

                           curl_setopt($curl,CURLOPT_POST, sizeof($xml));

                           // This is the fields to post in the form of an array.

                           curl_setopt($curl,CURLOPT_POSTFIELDS, $xml);

     

                           //execute the post

                           $result = curl_exec($curl);

                           $info = curl_getinfo($curl);

                           echo curl_getinfo($ch) . '<br/>';

    echo curl_errno($curl) . '<br/>';

    echo curl_error($curl) . '<br/>';

                           curl_close($curl);



  • 2.  RE: Aruba 3200 (US) Mob Cntrlr w 8 AP Bndl - inquiry for XML module on Aruba WLAN controllers

    EMPLOYEE
    Posted Nov 07, 2016 11:48 AM

    Did you already configure the controller with the XML-API server and then assign it to a AAA profile?



  • 3.  RE: Aruba 3200 (US) Mob Cntrlr w 8 AP Bndl - inquiry for XML module on Aruba WLAN controllers

    Posted Nov 07, 2016 11:51 AM

    Thank you for your reply.

     

    Yes, I have already configured the xml api and assigned to aaa profile.



  • 4.  RE: Aruba 3200 (US) Mob Cntrlr w 8 AP Bndl - inquiry for XML module on Aruba WLAN controllers

    Posted Nov 10, 2016 11:56 AM

    Have figured out issue and now the curl request is executing. but now, I am getting 

    "invalid message digest" error. 

    When I refer to the doc, it says - 

    This is due to a mismatch in secret between the XML server and the controller XML API profile. If using non cleartext, this could be an error in the calculation of the hashed secret.

     

    Yes my Key is not clear text. how should I fix it? should I use only cleartext key?

     

    Thank you!

    <aruba>
    <status>Error</status>
    <code>7</code>
    <reason>invalid message digest</reason>
    </aruba>

     



  • 5.  RE: Aruba 3200 (US) Mob Cntrlr w 8 AP Bndl - inquiry for XML module on Aruba WLAN controllers

    Posted Nov 10, 2016 01:23 PM

    I am able to figure out the issue with the key. When I replace the authentication method to “Cleartext”, I was able to get rid of the key error. And the API request works fine.

     

    But when I query the API from our application for random user, I don’t know the user’s IP address, So I  should be able to query the API just only with MAC address.  As per the document, I  understand that the IP address is mandatory for all API request. 

     

    When I  run the API request without IP address, I am  receiving the following error message.:

    <aruba>

      <status>Error</status>

      <code>1</code>

      <reason>unknown user</reason>

    </aruba>

    Can you please help me to figure out some solution to this? Getting API working by just passing MAC address, key, authentication, and version.