New answers tagged

0

For me it worked: UserData should contains at least an empty Map of attributes(the last paramter in constructor). Otherwise you will recieve Internal Server error.


0

PKCE is an enhancement that only applies to authorization code grant (aka Web Server flow in Salesforce). From RFC 7636: OAuth 2.0 public clients utilizing the Authorization Code Grant are susceptible to the authorization code interception attack. This specification describes the attack as well as a technique to mitigate against the threat through ...


1

In case someone else stumbles upon this in the future - I was having a problem due to a setting in the Manage Apps > Connected Apps > Manage > Edit Policies. Under oAuth settings, there is an option called "Refresh Token Policy". Mine was set to expire immediately by default for the app I am developing. Please change it to Refresh token is valid until ...


3

Special characters in the username or password need to be URL encoded. While I ordinarily don't approve of posting access credentials in a forum, especially here, it's apparent that the & in your password is causing the problem. The & should be encoded as %26. And yes, you should be using your scratch org's host name to get the token; Scratch Orgs do ...


0

"user hasn't approved this consumer" This is a common error caused when the user doesn't have a prior refresh_token associated with him/her. The solution is to perform an Autorization grant (Web Server flow or User-Agent Flow) at least once, specifically see step #3 at https://mannharleen.github.io/2020-03-03-salesforce-jwt/ That should solve the error."...


0

"user hasn't approved this consumer" This is a common error caused when the user doesn't have a prior refresh_token associated with him/her. The solution is to perform an Autorization grant (Web Server flow or User-Agent Flow) at least once. I wrote in detail about it; look specifically at step #3 here - https://mannharleen.github.io/2020-03-03-salesforce-...


0

Despite many hours of increasing desperation, I have never been able to find a way to get a refresh token from the initial authorization flow, as it is implied should happen by the above answer and others like it. The only thing that has worked for me is: curl -v -L \ -F 'response_type=token' \ -F 'client_id=<consumer key of connected app>' \ -F '...


Top 50 recent answers are included