Developer Community

New Contributor

obtain Aruba ClearPass access token

I would like to access the Aruba ClearPass REST API. The administrator granted me access to ClearPass with an account using


as the username and 


as the password. First I created an API client, these are my settings:



Next I want to obtain an access token, so I pass in my credentials



Unfortunately I get a 401 response


  "type": "",
  "title": "invalid_grant",
  "status": 401,
  "detail": "Invalid username and password combination"

I also tried to use Postman for testing purposes. I call a POST with the url

but instantly get this response


What am I missing or what might be wrong? Thanks in advance


MVP Guru Elite

Re: obtain Aruba ClearPass access token



Do you have a Oauth2 service ?


With a token it is working ?

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

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

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

PowerArubaIAP: Powershell Module to use Aruba Instant AP

PowerArubaMC: Powershell Module to use Mobility Controller / Master

ACMP 6.4 / ACMX #107 / ACCP 6.5 / ACSP
Aruba Employee

Re: obtain Aruba ClearPass access token



Which version of ClearPass are you using?


You would have auto generated client secret while creating the API client. Or if you API client has already been created, you would have option to generate client secret while editing the existing API client. 


Once you have the client id and client secret, you would be able to generate a token. Refer the python script in Aruba's Official GitHub Repo which does that.


    url = "https://<clearpass_fqdn>/api/oauth"
    headers = {'Content-Type':'application/json'}
# grant_type: password payload = {
MVP Guru

Re: obtain Aruba ClearPass access token

Your logs indicate that the username & password are not accepted. Do you see the authentication for the username that you used in Access Tracker?


Here is the service that I have in my deployment for the REST user authentication:

Screen Shot 2019-12-12 at 09.54.24.png

Please make sure you see the authentication coming in in Access Tracker, match on the right service, and return an Application Accept.

If you have urgent issues, please contact your Aruba partner or Aruba TAC (click for contact details).