1

I am trying to connect Salesforce (REST API) from SAP CPI through Rojo Salesforce adapter. The connected app was created in Salesforce and the respective credential details given below was configured in CPI.

  1. Username & Password: (saved as user credential type in CPI security material)
  2. Security Token: (saved as secure parameter type in CPI security material)
  3. Consumer key and Consumer Secret: (saved as user credential type in CPI security material)

But we are getting the below error in CPI:

<error>invalid_grant</error>
<error_description>authentication failure</error_description>

All the configurations in CPI and Salesforce seems to be good from my end.

The methods which we have tried were:

  1. Tried from postman using the OAuth2.0 authorization, we were able to reach the salesforce login page by getting a 200 ok response code, but we were unable to post anything to Salesforce.
  2. Tried creating a new connected app by deleting the old one, but fails again with the same error.
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Vaisu Raj
  • 11
  • 1

1 Answers1

0

What (if any) error do you see in SF setup in this user's login history. What "base url" you're connecting to. Just login.salesforce.com / test.salesforce.com without sub-pages are for humans, not APIs.

It sounds like you're using "username password flow" so the POST should go to https://login.salesforce.com/services/oauth2/token

The endpoints, available grants, scopes etc are listed in https://login.salesforce.com/.well-known/openid-configuration (or whatever domain works for you, your branded domain, test.salesforce.com or branded sandbox)

eyescream
  • 18,088
  • 2
  • 34
  • 46