Cloud Managed Networks

 View Only
last person joined: 3 days ago 

Forum to discuss all things related to HPE Aruba Networking Central and UXI Network Management, including deployment of managed networks, configuration, best practices, APIs, Cloud Guest, AIOps, Presence Analytics, and other included Applications
Expand all | Collapse all

REST API : To obtain CSRF Token and Sessionkey

This thread has been viewed 25 times
  • 1.  REST API : To obtain CSRF Token and Sessionkey

    Posted Oct 21, 2021 05:59 PM

    hi Team,

    We are trying to use the API to pull events data and since the tokens expire often we would like to Login and then get the required tokens as mentioned in the document. In the obtaining tokens section.

    We are trying to use the steps 4 and 5. Am able to refresh the token and get access token and get the details am looking for when am already aware of the refresh token first time. Here since we are trying to build a script using the API calls, we need to get the CSRF token, session key and then using them get the authorization code which inturn gives the refresh and access tokens.

    But am not able to get the CSRF token and session key itself and when am giving the username , password and clientId , it always throws me below error.

    {
        "extra"null,
        "message""Invalid Request body"
    }
    Can someone help me what exactly i might be doing wrong here. Am testing it from Postman. Base url is 
    https://apigw-eucentral2.central.arubanetworks.com/oauth2/authorize/central/api/login?client_id=XXXXXXXXXXXXXXXX

    Aruba Central API Reference Guide (arubanetworks.com)

    Any help is much appreciated!

    Thanks in Advance!



    ------------------------------
    Sreedhar Sri
    ------------------------------



  • 2.  RE: REST API : To obtain CSRF Token and Sessionkey

    EMPLOYEE
    Posted Oct 23, 2021 01:45 PM
    Hi,

    I suggest you follow the steps listed here (Step 1 Login and Obtain CSRF Token in particular)
    https://developer.arubanetworks.com/aruba-central/docs/api-oauth-access-token


    ------------------------------
    Ayman Mukaddam
    ------------------------------



  • 3.  RE: REST API : To obtain CSRF Token and Sessionkey

    Posted Oct 24, 2021 05:23 AM

    hi Ayman,

    Thanks for your reply! I have tried from the above link, and am getting below error

    {

        "message": "ERROR_SSO_AUTHENTICATION",

        "status": false

    }

    Does this means some authorization issues with mya ccount for this API ?

    I have tried the refresh Token API and am ableto get the latest refresh token and Access Token but the initial steps are failing.

    Thanks,

    Sreedhar



    ------------------------------
    Sreedhar Sri
    ------------------------------



  • 4.  RE: REST API : To obtain CSRF Token and Sessionkey

    Posted Jun 24, 2022 09:20 AM
    Hi. I know this post is quiet bit old but I need this help too. I already follow the webpage you mention there but it still gave that error. One this I notice my host URL does not appear on the list. Our host is in eucentral3. was we need to call the EU-1 region's API?