Issue
The Danish national 2FA service MitId recently got a bit of an update, which has messed up app switching on our React Native app.
I'm running a website in a WebView
which as part of the expected behaviour needs to open the MitId 2FA app to perform authentication.
However, when I try doing this on Android (iOS works fine), I get the following error:
Can't open url: intent://appswitchmitid.page.link/?link=https://appswitch.mitid.dk?ticket%<long string of hexadecimal numbers here>%26returnUrl%3DChrome&apn=dk.mitid.app.android&afl=https://appswitch.mitid.dk#Intent;package=com.google.android.gms;action=com.google.firebase.dynamiclinks.VIEW_DYNAMIC_LINK;scheme=https;S.browser_fallback_url=https://appswitch.mitid.dk;end;
I'm not super familiar with the inner workings fot he intent bus on Android, so I'm mostly looking for guidance to figure out exactly what I'm supposed to do with this URL so that I can dispatch the app switching myself.
PS: I am aware of this question: How to open URL with scheme intent:// on react native
It doesn't help.
Solution
WebViews are not supported anymore on Android, you should change your implementation to use Custom Tabs instead.
From Signaturgruppen's own technical reference:
Embedded browsers, i.e.WebViews, are not supported and not allowed – thus integrations must adhere strictly using to the Android Custom Tabs (Chrome or Samsung browser) or iOS SFSafariViewController (TAB) for all MitID integration flows. MitID requires that the address bar is visible, such that the end-user can see the https and MitID domain when authenticating with MitID. Android Custom Tabs: https://developer.chrome.com/docs/android/custom-tabs/ iOS SFSafariViewController: https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller
You can read about the new requirements here: https://broker.signaturgruppen.dk/application/files/1816/8742/0440/Nets_eID_Broker_MitID_mobile_app_integration_v2.5.pdf
Answered By - Malou
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.