Android Capture OpenID Connect (OIDC) not working on Samsung devices

Hello everyone,

OIDC seems not to be working on Samsung devices in Android Capture app v2.4.3. After the configuration of OIDC in a clone of the Android Capture app v2.4.3 as described in the wiki, and rebuilding the app, the OIDC button fails to respond when clicked on a Samsung device. Further investigation in logcat and flipper revealed the error below is thrown whenever the OIDC button is clicked:

2021-11-10 11:04:36.919 3523-3523/com.dhis2.debug E/LoginPresenter$openIdLogin - 231: android.content.ActivityNotFoundException
        at net.openid.appauth.AuthorizationService.prepareAuthorizationRequestIntent(
        at net.openid.appauth.AuthorizationService.getAuthorizationRequestIntent(
        at net.openid.appauth.AuthorizationService.getAuthorizationRequestIntent(
        at io.reactivex.internal.operators.single.SingleMap$MapSingleObserver.onSuccess(
        at io.reactivex.internal.operators.single.SingleMap$MapSingleObserver.onSuccess(
        at io.reactivex.internal.operators.single.SingleCreate$Emitter.onSuccess(
        at net.openid.appauth.AuthorizationServiceConfiguration$ConfigurationRetrievalAsyncTask.onPostExecute(
        at net.openid.appauth.AuthorizationServiceConfiguration$ConfigurationRetrievalAsyncTask.onPostExecute(
        at android.os.AsyncTask.finish(
        at android.os.AsyncTask.access$900(
        at android.os.AsyncTask$InternalHandler.handleMessage(
        at android.os.Handler.dispatchMessage(
        at android.os.Looper.loop(
        at java.lang.reflect.Method.invoke(Native Method)

This was tested on Samsung Tab A, Samsung Galaxy A71, Motorola E4 Plus and Android emulator, however it only works on the Android emulator and the Motorola device while Samsung devices trigger the error above.

We tried setting Chrome as the default browser on the Samsung devices, however this doesn’t seem to improve the experience. Further digging around revealed that a similar issue was reported awhile back on the Openid AppAuth Android library.

Any ideas on how to get around this?

Thank you.


Hello Babatunde,

Thanks for reporting this. I have tested it in another Android device (Tecno Spark 7 with android 11).
It’s was not working. It looks like the issue is related to the android version.
In my research I found this Changes needed when targetting SDK 30+ · Issue #599 · openid/AppAuth-Android · GitHub

The new package visibility changes in Android 11 means that all of the queryIntentActivities() call is broken.
As per the docs, the following should be added to your app’s manifest when targeting SDK 30 and above:

        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="https" />

        <action android:name="" />

Let’s explore it.


Hello @diallotafsir52,

Will explore that and let you know how it goes.


Hello @diallotafsir52,

Happy to announce that the proposed fix works.

Thanks for your help.