apnex / vmw-cli

CLI and API for programmatic access to my.vmware.com
MIT License
30 stars 9 forks source link

AUTH Error performing a LS #10

Open brharr opened 2 years ago

brharr commented 2 years ago

I just installed everything on to a Bootstrap machine in my Cloud environment and I have verified over and over again that the VMWUSER and VMWPASS are correct and equal to what I use in Customer Connect. I have also verified that I am able to list and download from the website using this user id and password. However, I keep getting the Auth Error stating that I should look at my environment variables.

sudo vmw-cli ls vmware_tanzu_kubernetes_grid [POST] https://customerconnect.vmware.com/channel/api/v1.0/ems/accountinfo [INFO]: 401 - Attempting new login [GET] https://customerconnect.vmware.com/web/vmware/login [GET] https://customerconnect.vmware.com/login [GET] https://customerconnect.vmware.com/channel/auth/login [GET] https://customerconnect.vmware.com/vmwauth/oauth/authorize [GET] https://auth.vmware.com/oamfed/idp/samlv20 [GET] https://customerconnect.vmware.com/login [POST] https://auth.vmware.com/oam/server/auth_cred_submit [ERROR]: AUTH-ERROR please check environment variables [ $VMWUSER ] and [ $VMWPASS ] are correct and try again!

Thoughts? Brian

apnex commented 2 years ago

Hi Brian,

I've just run a quick test from my end and seems to be running ok.

[root@obpc ~]# vmw-cli ls vmware_tanzu_kubernetes_grid vmw-cli 58a1709ad9331c7b1dcb4f4822013b34532f4514887f3e18f6d1f4b41903de62 [WARN]: AUTH-CHANGE - [undefined : username@domain.com] [CLEAR]: All state cleared [POST] https://customerconnect.vmware.com/channel/api/v1.0/ems/accountinfo [INFO]: 401 - Attempting new login [GET] https://customerconnect.vmware.com/web/vmware/login [GET] https://customerconnect.vmware.com/login [GET] https://customerconnect.vmware.com/channel/auth/login [GET] https://customerconnect.vmware.com/vmwauth/oauth/authorize [GET] https://auth.vmware.com/oamfed/idp/samlv20 [GET] https://customerconnect.vmware.com/login [POST] https://auth.vmware.com/oam/server/auth_cred_submit [POST] https://customerconnect.vmware.com/vmwauth/saml/SSO [POST] https://customerconnect.vmware.com/vmwauth/oauth/authorize [GET] https://customerconnect.vmware.com/channel/oauth2/code/myvmware [GET] https://customerconnect.vmware.com/group/vmware/establish_session [GET] https://auth.vmware.com/oam/server/obrareq.cgi [GET] https://customerconnect.vmware.com/obrar.cgi [GET] https://customerconnect.vmware.com/group/vmware/establish_session [INFO]: Re-authentication completed, trying call again... [POST] https://customerconnect.vmware.com/channel/api/v1.0/ems/accountinfo [GET] https://customerconnect.vmware.com/channel/public/api/v1.0/products/getProductsAtoZ [GET] https://customerconnect.vmware.com/channel/public/api/v1.0/products/getRelatedDLGList [GET] https://customerconnect.vmware.com/channel/public/api/v1.0/products/getDLGHeader [GET] https://customerconnect.vmware.com/channel/api/v1.0/dlg/details

The most common issue with the AUTH-ERROR is forgetting to wrap your username and password in single-quotes like this: export VMWUSER='username@domain.com' export VMWPASS='password'

You could also try deleting the container (docker rmi -f) and re-pulling to see if that makes any difference Hope this helps

brharr commented 2 years ago

I am not using the container, I am using the Node package directly within my Linux VM.

I did use the single quotes when I did my export commands, but they do not show when I do an env command to validate the values are correct.

In addition, my user was just created today as I am a fairly new VM Ware employee and I never needed access before. I don't know if that makes a difference to the API that you are using.