Skip to content

Redirect from browser with a different deep link than defined in redirectUrl config does not work #952

@ggarcia92

Description

@ggarcia92

Issue

We have a button at the authorization form that redirects to the app with a deep link different than the one configured in the redirectUrl, for example: the redirectUrl is myapp://redirect and the other button redirects to myapp://someother; in this scenario the browser get closed but iOS does not detect the deep link, so the method:

(BOOL) application: (UIApplication *)application openURL: (NSURL *)url options: (NSDictionary<UIApplicationOpenURLOptionsKey, id> *) options 

is never executed. In other words, we cannot use deep links on the authentication page in iOS.

We were able to solve this in Android by modifying the AndroidManifest like this:

<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:allowBackup="false" android:theme="@style/AppTheme" android:supportsRtl="true"> <activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|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> <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="${appAuthRedirectScheme}" android:host="someother" /> </intent-filter> </activity> <activity android:name="net.openid.appauth.RedirectUriReceiverActivity" android:exported="true" 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="${appAuthRedirectScheme}" android:host="redirect" /> </intent-filter> </activity> </application> 

Environment

  • Your Identity Provider: Own OIDC service
  • Platform that you're experiencing the issue on: iOS
  • Your react-native Version: 0.73.6
  • Your react-native-app-auth Version: 7.1.0
  • Are you using Expo? No

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions