Salesforce Authentication Failing

前端 未结 11 1523
南方客
南方客 2020-11-30 19:05

I am trying to use OAuth authentication to get the Salesforce Authentication Token, so I referred wiki docs, but after getting authorization code, when I make a Post request

11条回答
  •  南方客
    南方客 (楼主)
    2020-11-30 19:46

    We had this issue as well.

    Check your Connected App settings - under Selected OAuth Scopes, you may need to adjust the selected permissions. Our app primarily uses Chatter, so we had to add both:

    • Access and manage your Chatter feed (chatter_api)
    • Perform requests on your behalf at any time (refresh_token).

    Again, your mileage may vary but try different combinations of permissions based on what your Application does/needs.

    Additionally, the actual invalid_grant error seems to occur due to IP restrictions. Ensure that the server's IP address that is running the OAuth authentication code is allowed. I found that if the SFDC environment has IP restriction setting Enforce IP restrictions set (Setup -> Administer -> Manage Apps -> Connected Apps), then each User Profile must have the allowed IP addresses as well.

提交回复
热议问题