Developer

 View Only
  • 1.  Powershell auth token issue

    Posted Oct 06, 2025 12:36 PM

    Hey there,

    I have a powershell script that we use to connect to the central api to parse one of our guest portals for a list of users to automatically reset the password weekly, This was working for years and then appears to have stopped working June 23rd 2025. Has anything changed that would cause the api to no longer connect? The way we connect is by getting a CSRF token and using that to get the Auth token. I am getting the CSRF token properly but then get 401 unauthorized when it comes to the auth token.



    -------------------------------------------


  • 2.  RE: Powershell auth token issue

    Posted Oct 07, 2025 08:48 AM

    Does anyone have a working powershell script to just connect to the old central API? If I generate the token in the GUI and enter it manually in my script, it runs properly so my problem is with the api authentication. 

    -------------------------------------------



  • 3.  RE: Powershell auth token issue

    Posted Oct 07, 2025 10:14 AM

    Hi Mike,

    What api call do you are using ?

    your account don't migrate to CNX ? (New Central) 

    You can look the PowerArubaCP module for the connect (and api call)



    ------------------------------
    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: Powershell auth token issue

    Posted Oct 07, 2025 10:54 AM

    It doesn't look like the new central contains the same guest portal api endpoints that I need for my script. My script pulls all accounts tied to the guest portal, and then loops through and randomizes the passwords. I am not using PowerArubaCP module, I was connecting manually by getting the csrf token which I then used to get the access token. I was able to get a work around going myself this morning by first generating the access token in the GUI, then using the refresh token to regenerate the access tokens. My script runs weekly so hoping my approach will continue to work. I generate the new access token to use in the API calls and store the new refresh token for subsequent runs of the script. 

    -------------------------------------------