pozil / salesforce-react-integration

Sample integration project between Salesforce and a React.js application
Apache License 2.0
68 stars 62 forks source link

error=invalid_client_id&error_description=client%20identifier%20invalid #15

Closed benramsay closed 1 year ago

benramsay commented 1 year ago

I created a new Connected App from the App Manager with

Callback URL = http://localhost:8080/auth/callback

Then I complete the .env file:

loginUrl='https://login.salesforce.com' callbackUrl='http://localhost:8080/auth/callback/' consumerKey='----------------------------' consumerSecret='----------------------------' apiVersion='56.0' isHttps='false' sessionSecretKey='A_SECRET_STRING'

I kept the "sessionSecretKey" as it is (as you can notice).

When running the application, and clicked the login button, I had this message :

error=invalid_client_id&error_description=client%20identifier%20invalid

Any idea what I missed? Thx

benramsay commented 1 year ago

I put everything in the "Selected OAuth Scopes" of the Connected App, and that solves the login problem. I think there is only one choice to select in this field, but still new with salesforce, and I don't know which one!

pozil commented 1 year ago

Hi @benramsay, you only need the API OAuth scope for the connected app. What is tricky though is that there's a latency when configuring those apps. Sometimes, config changes may take up to 5-10 minutes to show up. In those rare cases, you may see errors like "client identifier invalid" like you had although your configuration is correct.