6

New Edit: I've narrowed down the issue. It only happens with a particular Visualforce page. /apex/SuccessFrame does NOT work for some reason. It works fine on iOS, I changed the Visualforce page and I can log in - in fact, I can even change the starting page once the device has the OAuth token and reinstall it to get to it. However, it does not work when authenticating. Is there some setting that would cause this to happen?

Okay, so I've got my hybrid app developed and distributed for iOS. I'm trying to port it over to Android.

The same connected app is being used to handle the OAuth scope, the bootconfig.json is the same. I set up the server.xml file to point the user to the correct page on page load:

<?xml version="1.0" encoding="utf-8"?>
<servers>
  <server name="Success Hub" url="https://page1success.force.com/SuccessHub/login"/>
</servers>

This is the same one I use on iOS. When I log in, I get an 'insufficient privileges' error and it doesn't load my custom VisualForce page - why is this?

When I look at the documentation for configuration of custom login server, it shows this:

    <?xml version="1.0" encoding="utf-8"?>
<servers>
  <server name="XYZ.com Login" url="https://<username>.cloudforce.com"/>
</servers>

What is the username parameter? Does that have to do with this?

Recap:

bootconfig.json is the same

I get to the correct login page

It gives me insufficient priveleges despite OAuth Redirect URI and Consumer Key being the same as an iPhone app that I've already developed.

I'm at a loss.

EDIT: I've tried changing the callback url to a custom URL scheme (e.g. sfdc://success) in a new connected app and made sure that the profile has access to it and still get insufficient privileges. I'm starting to wonder if there's a bug.

Profile has correct permissions to access the app, the callback URL is correct, the consumer key is correct, the servers.xml is set up properly from what I can tell.

{
"remoteAccessConsumerKey": "3MVG9iTxZANhwHQtOoegoCi2PwGicX0bX_FB9N05V7CuPdd.T8RCJA60MB6Vw8R8syBmdSmNHIRdIuNbS9ThW",
"oauthRedirectURI": "sfdc://success",
"oauthScopes": ["web", "api"],
"isLocal": false,
"startPage": "/apex/SuccessFrame",
"errorPage": "error.html",
"shouldAuthenticate": true,
"attemptOfflineLoad": false,
"androidPushNotificationClientId": ""

}

I've also tried changing the oauthRedirectURI to successhub:///mobilesdk/detect/oauth/done

1

I've had this happen a couple of times. In the past I've resolved it by re-creating the connected app and getting new oauth keys.

it's voodoo, but it's almost like there's an intermittent failure of the oauth bit with a given set of credentials.

| improve this answer | |
  • Yeah, I think I might have it fixed by forcing the Start URLs (Mobile and Web) for the connected app to the absolute path (page1success.force.com/SuccessHub/apex/SuccessFrame) and also setting the StartPage to /apex/SuccessFrame. Once I get a few devices and test I'll update this. I didn't have to do that on iOS. Very weird. – Command-Z Dec 19 '13 at 21:21
1

Okay, so after trying a myriad of things this seems to work.

Just make the webpage start URL and mobile start URL the full path (https://mysite.force.com/mycommunity/apex/mypage/) in the Connected App in Salesforce. I'm not sure if they need to be the same, but that's what I did.

Now it works.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.