The Requested Scope is not Allowed

Building a Cordova hybrid app with the Salesforce 1.5 sdk (iOS)

I’ve just cloned the SalesforceMobileSDK (ios) repo, ran the ./install.sh script and opened x-code and selected a new salesforce hybrid app and after re-adding the www folder, I get a lovely signin screen. However upon entering valid credentials I get:

DEBUG|0|SFAuthenticationManager|oauthCoordinator:didFailWithError: Error Domain=com.salesforce.OAuth.ErrorDomain Code=666 "com.salesforce.OAuth.ErrorDomain 1804 : the+requested+scope+is+not+allowed" UserInfo=0xa5ac9d0 {error_description=the+requested+scope+is+not+allowed, NSLocalizedDescription=com.salesforce.OAuth.ErrorDomain 1804 : the+requested+scope+is+not+allowed, error=1804}, authInfo: <SFOAuthInfo: 0xa5b6c90, authType=SFOAuthTypeUserAgent>

This is leading to some consternation. I’ve done some homework with aunt google, and it seems there was a bug, 2-3 months ago that was supposedly addressed (fixed) in the sdk that resolved this.

My Scope is set to: oauthScopes = [“web”,”api”];

Additionally, I just re-checked and re-pulled the repo, to try to address this issue.

Any help is appreciated.

Answer

According to https://help.salesforce.com/HTViewHelpDoc?id=sso_provider_addl_params_scope.htm&language=en_US and https://developer.salesforce.com/forums?id=906F00000009CO9IAM

We should not set connected app for full access but

Perform requests on your behalf at any time
Access and manage your data

If you’re developing a hybrid/web app, you also need the following additional scope:

Provide access to your data via the Web

Attribution
Source : Link , Question Author : Kevin P , Answer Author : pooran

Leave a Comment