Automation Suite Certificate error "Unauthenticated desc = Invalid username or password"

How to fix the error "Unauthenticated desc = Invalid username or password" during certificate export

Issue Description:

While exporting the TLS certificates using configureUiPathAS.sh, we get the error "Unauthenticated desc = Invalid username or password"

# ./configureUiPathAS.sh tls-cert get --outpath /tmp/certs/

FATA[0001] rpc error: code = Unauthenticated desc = Invalid username or password

[ERROR][2024-06-28T12:41:43+0000]: Failed to log in

#

Root Cause: The admin password secret is not in sync with argocd webportal password.

Resolution:

  1. Extract the admin secret using following command

# kubectl -n argocd get secret argocd-admin-password -o jsonpath="{.data.password}" |base64 -d

  1. Run the configureUiPathAS.sh script with bash -x option and note down the secret in argocd command listed in script output.

# bash -x configureUiPathAS.sh tls-cert get --outpath /tmp/certs/

  1. The extracted output would like look this:

+ argocd login alm.:443 --grpc-web --grpc-web-root-path / --username admin --password --insecure

FATA[0000] rpc error: code = Unauthenticated desc = Invalid username or password

+ error 'Failed to log in'

  1. Compare the secret/password in step 1 and step 2 and you will notice different value at both places.

  1. Encode the password shown in step 2 using command

# echo "" | base64

  1. Update the [.data.password] value in "argocd-admin-password" secret in argocd namespace with the secret value received in step 4.

# kubectl -n argocd edit secret argocd-admin-password -o yaml

  1. Now, export the certificates and it should be possible to export certificates.