time="####-##-###########" level=error msg="cloud director endpoint https://<VCD>:443/oauth/provider/token failed: {\"error\":\"invalid_grant\",\"error_description\":\"Invalid refresh token\",\"error_uri\":null,\"minorErrorCode\":\"invalid_grant\",\"message\":\"Invalid refresh token\",\"stackTrace\":null}" at gitlab.eng.vmware.com/core-build/ucd-addon-byokThe primary cause of the authentication failures is a VCD configuration parameter, vcloud.tokens.serviceAccountTokenRotation.enabled, which is set to true by default. This setting enforces a security policy where every request for a new access token also generates a new request token
To resolve this issue, we first to regenerate the refreshToken manually and then we can set the vcloud.tokens.serviceAccountTokenRotation.enabled flag to false, so that the request token will no longer rotate. To set this:
cli>your_operating_system folder:
./vcdemctl configure refresh-token --config /etc/config.yaml --host <VCD Address> --username <username> --password <password> --insecure
/opt/vmware/vcloud-director/bin/cell-management-tool manage-config -n "vcloud.tokens.serviceAccountTokenRotation.enabled" -v false
/opt/vmware/vcloud-director/bin/cell-management-tool manage-config -n "vcloud.tokens.serviceAccountTokenRotation.enabled" -l