function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
robboermanrobboerman 

Returning error: credentials.clientId cannot be nil or empty

Hello,

 

We are developing a HTML5 hybrid app that uses the hybrid SDK for authentication. Everytime we install the app on the iPad and use the OAUTHPlugin to authenticate with Salesforce we get the following error:

 

Aug 28 10:26:14 unknown fieldbuddy[8548] <Warning>: *** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSInternalInconsistencyException> credentials.clientId cannot be nil or empty

 

The authenticate method is called correctly like so:

 

PhoneGap.exec(success, fail, "com.salesforce.oauth", "authenticate", [JSON.stringify(oauthProperties)]);

 

With oauthProperties being (CHANGED keys for privacy):

{"remoteAccessConsumerKey":"3MV***************************","clientId":"3MV**********************","oauthRedirectURI":"testsfdc:///mobilesdk/detect/oauth/done","oauthScopes":["web","api"],"autoRefreshOnForeground":true}

 

When we go to the iPad settings, set 'Logout Now' to 'on' and go back to the app, suddenly the OAuth screen pops up. 

 

Can anyone tell me why the authenticate method in the SDK complains about a missing clientId when we do provide it in every call?

 

Thanks, 
Rob

erashwanierashwani
Hi Rob,

I'm also facing similar issue. 

Assertion failure in -[SFOAuthCoordinator authenticate], /Users/apple/ashu/SalesForce/dev/fpmd-forcepad/Pods/SalesforceMobileSDK-iOS/libs/SalesforceOAuth/SalesforceOAuth/Classes/SFOAuthCoordinator.m:169 2015-10-01 15:36:35.972  * WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: credentials.clientId cannot be nil or empty.

Please tell me how did you resolve that?