AppAuth-Android: The browser won't get closed and hence not able to catch the sign-in response

Hi, the demo app won’t return back to the caller activity after authentication is successful. I have used the default settings what was already made for this app. here is the manifest extract from the demo app.

<activity android:name="net.openid.appauth.RedirectUriReceiverActivity" 
          tools:node="replace">
  <intent-filter>
    <action android:name="android.intent.action.VIEW"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.BROWSABLE"/>
    <data android:scheme="https"
          android:host="net.openid.appauthdemo"
          android:path="/oauth2redirect"/>
  </intent-filter>
</activity>

Is this default setting in the demo app needs to be modified? after succesful login, the browser wont get closed and hence not able to go back to the MainAcitivity of this app. (Also, I have not completely understood the redirect/uri scheme here. pls point me to the links that provide more info about it)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

This should do it:

BrowserBlacklist blacklist = new BrowserBlacklist(
    new VersionedBrowserMatcher(
        Browsers.SBrowser.PACKAGE_NAME,
        Browsers.SBrowser.SIGNATURE_SET,
        true, // custom tab
        VersionRange.ANY_VERSION));

AuthorizationService authService = new AuthorizationService(
    context,
    new AppAuthConfiguration.Builder()
        .setBrowserMatcher(blacklist)
        .build());

authService.performAuthorization(authRequest, completionIntent);

Once we have confirmation that custom tabs are fixed in SBrowser at a particular version, VersionRange.ANY_VERSION can be substitutedFor VersionRange.atMost(SBROWSER_FIX_VERSION) where SBROWSER_FIX_VERSION will be the last broken version number of SBrowser.