Cloud Managed Networks

 View Only
  • 1.  API access token questions

    Posted Nov 18, 2021 02:23 PM
    Hey Guys,

    Is there a way to generate a permanent access token to REST API access?
    I've just followed the API docs chapter OAuth APIs for Access Token which says the access token would expire after a certain time and requires refreshing. The expiring time would probably be indicated in the JSON block shown as below when we acquire the access token. 
    Does anyone know what this 7200 means? Is it 7200 minutes or 7200 hours of time for the token being valid? 

    {
    "refresh_token": "xxxx",
    "token_type": "bearer",
    "access_token": "xxxx",
    "expires_in": 7200
    }


    ------------------------------
    Lejian Wang
    ------------------------------


  • 2.  RE: API access token questions

    Posted Nov 18, 2021 04:24 PM
    no you can't create a permanent access token due to the security imperfections.
    That 7200 is in sec, so the access token expires in 2 hours and you need to refresh it before that.

    ------------------------------
    Any opinions expressed here are solely my own and not necessarily that of Hewlett Packard Enterprise or Aruba.
    ------------------------------



  • 3.  RE: API access token questions
    Best Answer

    Posted Nov 25, 2021 05:09 AM
    But you can use refresh_token to access a new access_token (it is valid more longer...)

    ------------------------------
    PowerArubaSW : Powershell Module to use Aruba Switch API for Vlan, VlanPorts, LACP, LLDP...

    PowerArubaCP: Powershell Module to use ClearPass API (create NAD, Guest...)

    PowerArubaCL: Powershell Module to use Aruba Central

    PowerArubaCX: Powershell Module to use ArubaCX API (get interface/vlan/ports info)..

    ACEP / ACMX #107 / ACDX #1281
    ------------------------------



  • 4.  RE: API access token questions

    Posted Dec 06, 2021 01:09 AM
    here you can find the sample python script tat uses refresh_token
    https://community.arubanetworks.com/community-home/digestviewer/viewthread?MID=30657

    ------------------------------
    Any opinions expressed here are solely my own and not necessarily that of Hewlett Packard Enterprise or Aruba.
    ------------------------------