AzureAD / microsoft-authentication-library-for-android

Microsoft Authentication Library (MSAL) for Android
http://aka.ms/aadv2
MIT License
211 stars 125 forks source link

Error: Intent filter for: BrowserTabActivity is missing. Please make sure you have the following activity in your AndroidManifest.xml #2127

Closed Mradul296 closed 2 months ago

Mradul296 commented 3 months ago

I have a react native android app which is using AAD B2C for authentication with MSAL library. I have added the below intent filter in my AndroidManifest.xml file but I still get "Error: Intent filter for: BrowserTabActivity is missing. Please make sure you have the following activity in your AndroidManifest.xml" when the try to initialize the PublicClientApplication.

My manifest|

`

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

<application
  android:name=".MainApplication"
  android:label="@string/app_name"
  android:icon="@mipmap/ic_launcher"
  android:roundIcon="@mipmap/ic_launcher_round"
  android:allowBackup="false"
  android:theme="@style/AppTheme">
  <meta-data
      android:name="com.google.android.geo.API_KEY"
      android:value="key"/>
  <uses-library android:name="org.apache.http.legacy" android:required="false"/>
  <activity
    android:name=".MainActivity"
    android:label="@string/app_name"
    android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
    android:launchMode="singleTask"
    android:windowSoftInputMode="adjustResize"
    android:exported="true">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
  </activity>
  <activity
    android:name="com.microsoft.identity.client.BrowserTabActivity">
    <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="msauth"
            android:host="com.lyfter"
            android:path="/signature_hash" />
    </intent-filter>
</activity>
</application>

`

Smartphone (please complete the following information):

Stacktrace Error:

`[Error: Intent filter for: BrowserTabActivity is missing. Please make sure you have the following activity in your AndroidManifest.xml

]`

Screenshots image

Additional context One thing to note here is that the error still shows old values for host(package name) and path(hash). if you see in manifest.xml, I have updated these values but the error still shows older settings.

Mradul296 commented 3 months ago

I also used the below command to debug app-debug.apk file and I can see the updated intent filter is present

apktool d -o output_directory_name app-debug.apk

Screenshot (45)

misiektg86 commented 3 months ago

Any progress on this ?

misiektg86 commented 3 months ago

Any progress on this ?

Ok. In my case, it turned out to be the wrong authorization endpoint passed to the client app

negoe commented 2 months ago

@misiektg86 Please post your issue on the right path here.