In our Android app, I am having an issue where the dropbox.com authorize web page does not redirect back to our app when the user clicks the Allow button. I wrote a sample app and the OAuth2 flow works fine with that app on the same device\environment.
The first time you click the Allow button once the page displays, the page seems to refresh in Chrome. It seems like it's redirecting back to itself. The app does show up as connected to the account when I look in Settings for the user on dropbox.com. So that part of the auth flow is working - it's just not redirecting to the app.
I added the AuthActivity to the manifest...
<activity
android:name="com.dropbox.core.android.AuthActivity"
android:configChanges="orientation|keyboard"
android:launchMode="singleTask">
<intent-filter>
<!-- Insert your app key after “db- ...” -->
<data android:scheme="db-xxxxxxx" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
And I am calling Auth.startOAuth2Authentication() here...
public void authenticateNewDropbox(Activity con) //++ Added con param
{
// Set bool so we know on Resume that we're logging into Dropbox
mIsDropboxLogin = true;
//Kick off auth2 flow: this launches the browser, and then back to us in OnResume() in the Activity
Auth.startOAuth2Authentication(con, con.getResources().getString(R.string.APP_KEY));
}
The app was previously doing OAuth2 with the v1 SDK and it worked fine. I've tried a new AppID as well. I don't see any relevant messages in the Android Monitor in Android Studio.
Been stuck on this for a couple days and I can't understand what I'm doing wrong. Thanks for any help.