i have face a lot of issues connecting sap cloud foundry from cf cli. the issue includes, failed authentication, unauthorized, locked password etc.
the solution, turns out is to use `
`cf login –sso, which would use the temporary authentication code from the API, which worked.
source:
https://community.sap.com/t5/technology-q-a/cloud-foundry-login-error/qaq-p/12477996