21

So I'm using the iOS Mobile SDK. I had an app working without issue, then changed the Consumer key to that of a different connected app (i.e. changed away from the default sample one) and updated the success URL as well.

Ever since then I've receieved this error when trying to sign in. I've killed all sessions, I've updated and saved that connected app, I've deleted the app, cleaned and rebuilt, and still no joy.

Anyone have any ideas? This message couldn't be any less useful.

WTAF

2
  • Not putting this as an asnwer because it's not an answer, but I created a new iOS app with the same key and callback URL and it worked. Then I tried the first app, and it worked also. Who knows.
    – Matt Lacey
    Commented Nov 20, 2015 at 2:31
  • Did you get any other ideas on this? I am getting the same, I have recreated the app 3 times and checked all elements, and still this error. I am just following the trailhead, so a bit frustrating.
    – dacology
    Commented Dec 2, 2015 at 22:05

5 Answers 5

15

After much trial and error. I think this may be due to simple mis-configuration of the Connected App.

Check the Scopes closely. For my trailhead app I needed the api, web, refresh_token scopes. I had omitted one of these. Obviously the scopes required will vary for the app, but at a minimum we need these 3.

oauth scopes

Scope parameter docs: https://help.salesforce.com/HTViewHelpDoc?id=remoteaccess_oauth_scopes.htm&language=en_US

3
  • 1
    For me, it started to work once I added api and refresh_token scopes to the connected app.
    – DCBoy
    Commented Feb 27, 2016 at 18:36
  • I was able to get it working when adding the basic info scope in addition to the ones mentioned above... interesting enough, it didn't work when I added "Full".
    – BradByte
    Commented Jan 9, 2017 at 21:36
  • @Matthew - Are you running the tomcat on 8080 or 8443 ? Unfortunately this solution not working for me. Could you please share the code? Commented Oct 14, 2017 at 17:21
3

For me, the same issue was fixed by using sfdx force:auth:device:login

Instead of authorizing via web login flow, I logged in using a device code.

Also, check that your salesforce instance has Salesforce CLI properly installed.

2

You may get this error if the scope param in your authorizationUrl request DOES NOT match the scopes you've added to the connected app.

For example:

https://test.salesforce.com/services/oauth2/authorize?response_type=code&prompt=login&scope=full

When you don't have the full scope on the connected app.

1
  • 1
    This is what got me past it (for now). Thank you for sharing this. Commented Feb 1, 2022 at 12:50
1

Go to Setup>>Connected Apps>>Salesforce CLI>>Edit Policies>>IP Relaxation>>Relax IP restrictions. This worked for me. Other workarounds to try are:

  • Log out completely from browser and try again.
  • Clear Cache and try again.
0

For me, this case I can to resolved with cli command like that:

  1. Open terminal in vscode typing sf force:auth:device:login on your terminal hit enter
  2. the logic progress of this cli command to show you the code on your device to connect and verification URL https://login.salesforce.com/setup/connect go to the url verification above and typing code device, then hit enter
  3. Connect successful the terminal will show you like that: enter image description here
New contributor
Chung Nguyen is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .