User is never authorized
It does not matter how many times you validate the user through oauth2.0 User Server Flow, it always come back with "Some error occurred. Make sure connected app is approved previously. Salesforce Response : {"error":"invalid_grant","error_description":"user hasn't approved this consumer"}" I am analyzing myself why.
I also got this error etheir. @JitendraZaa Could you help us to figure it out why it happen. Appreciate any suggestion from you
Same same issue
Go to policies of connected App and change setting to "Preauthorized user can login" Add that user's profile in Connected app policy. This should resolve issue.
I tried Authorization many times but with no success; Finally , I went through the entire code and made a bit change in the Body where we pass the parameters :
Just change the order of parameters you are passing as given below
Old : Body(string iss,string aud,string prn,string exp){ this.iss=iss; this.aud=aud; this.prn=prn; this.exp=exp; }
New: Body(string iss,string prn,string aud,string exp){ this.iss=iss; this.aud=aud; this.prn=prn; this.exp=exp; }
Hope It works for you as well. Good Luck!
Go to policies of connected App and change setting to "Preauthorized user can login" Add that user's profile in Connected app policy. This should resolve issue.
Throwing below error with above setting: Some error occurred. Make sure connected app is approved previously. Salesforce Response : {"error":"invalid_request","error_description":"refresh_token scope is required and the connected app should be installed and preauthorized."} @JitendraZaa