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