I am inside the SAP Business Application Studio, inside the terminal, when I put the CF login command I enter my credentials and this appears
Authenticating... {"error":"invalid_grant","error_description":"User authentication failed: Unauthorized"}
Could you please help me
The solution on my side is to use the --sso option.
cf login --sso -a https://api.cf.us10.hana.ondemand.com
Afterwards you will be prompted to get a passcode from this url: https://login.cf.us10.hana.ondemand.com/passcode
However, for me this failed several times.
The key is to use alternative identity provider on the login screen
and enter sap.ids as provider when you already have an SAP Universal login

Sadly, this does not work when using trial version in API endpoint https://api.cf.us10-001.hana.ondemand.com . I already opened a support request.
I had the same problem and solved it by using P-User and password, instead of username and password.
cf login -a <cloud_foundry_api> -u <your_p_or_s_user> -p <your_password>
The same thing happens for the BTP CLI.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With