PowerAruba / PowerArubaCL

PowerShell module to managed Aruba Central (Cloud)
Apache License 2.0
3 stars 8 forks source link

Powershell credentials. #15

Open tmckean opened 8 months ago

tmckean commented 8 months ago

When attempting to connect to the PowerArubaCL using the "Connect-ArubaCL" command, I'm immediately prompted with Powershell credentials. Where are these created? I've used my Aruba Central credentials, a local account, and few other combinations with no luck. I even tried to create one using "Get-Credential" within PS.

alagoutte commented 7 months ago

Hi,

Do you have following the example : https://github.com/PowerAruba/PowerArubaCL?tab=readme-ov-file#examples

tmckean commented 7 months ago

Hi Thanks! I do. This is the example I was following to gain access. So it states to use your credentials for your Aruba Central account, but is it required to create some sort of an API role under the HPE / Central site? I am the primary on our organization's Central account and should have full read/write to anything, but when I enter my creds in the PowerShell popup window, it returns a 401 unauthorized. If I knew where to service those credentials, I could change the permissions necessary to make the credentials work.

I can say that your AOS Switching PS worked for me no issues... but that is not reaching out to the Central platform, so I'm at a loss on how to set these credentials.

Appreciate your help!

alagoutte commented 7 months ago

Hi Thanks! I do. This is the example I was following to gain access. So it states to use your credentials for your Aruba Central account, but is it required to create some sort of an API role under the HPE / Central site? I am the primary on our organization's Central account and should have full read/write to anything, but when I enter my creds in the PowerShell popup window, it returns a 401 unauthorized. If I knew where to service those credentials, I could change the permissions necessary to make the credentials work.

I can say that your AOS Switching PS worked for me no issues... but that is not reaching out to the Central platform, so I'm at a loss on how to set these credentials.

Appreciate your help!

Yes, need to create client_id (and secret) using Aruba Central / GreenLake portal... (i need to update screenshot!)

Grendel242 commented 7 months ago

When I use the connect-ArubaCL I am repeatedly presented with the following error. I have generated multiple tokens to try a different client ID, but I receive the same error each time. I'm entering my COP login credentials.

It looks like this is for Central Cloud, any reason it wouldn't work for Central On Prem as well? We leverage both.

Any assistance is appreciated.

WARNING: The Aruba Central API sends an error message: WARNING: Error description (code): (400) WARNING: Error details: {"extra":null,"message":"Invalid client ID"}

Update: Did some more testing after posting this.

  1. Worked great on Central Cloud (nice work)
  2. Failed on Central on Prem, however I discovered it's the path back in thats blocked. I'll be working to open that up and then test again, but after the other tests, I'm feeling pretty confident it will work.
alagoutte commented 7 months ago

Hi @Grendel242, i don't have COP... and can't try but welcome for PR for adding support

Actually, the "region" is hardcoded to list of Central Cloud => https://github.com/PowerAruba/PowerArubaCL/blob/master/PowerArubaCL/Public/Connection.ps1#L87

Need to add a way to add your COP url

alagoutte commented 7 months ago

Hi Thanks! I do. This is the example I was following to gain access. So it states to use your credentials for your Aruba Central account, but is it required to create some sort of an API role under the HPE / Central site? I am the primary on our organization's Central account and should have full read/write to anything, but when I enter my creds in the PowerShell popup window, it returns a 401 unauthorized. If I knew where to service those credentials, I could change the permissions necessary to make the credentials work.

I can say that your AOS Switching PS worked for me no issues... but that is not reaching out to the Central platform, so I'm at a loss on how to set these credentials.

Appreciate your help!

You can look https://developer.arubanetworks.com/aruba-central/docs/api-gateway-creating-application-token

I will look for update...