Skip to content

Align BankID app autostart with current BankID guidelines - #548

Merged
elinohlsson merged 8 commits into
mainfrom
pr-526-improved
Aug 27, 2026
Merged

Align BankID app autostart with current BankID guidelines#548
elinohlsson merged 8 commits into
mainfrom
pr-526-improved

Conversation

@torselden

Copy link
Copy Markdown
Contributor

Updates how Active Login launches the BankID app so it follows BankID's current autostart guidance. Autostart is the default on all supported devices, the recommended universal/app link is used on mobile, and the manual launch button is only shown as a fallback where a browser actually requires user interaction.

This PR fixes #534

High level overview of this PR

  • Use the universal/app link (https://app.bankid.com/) for all iOS and Android browsers, and keep the bankid:/// scheme for desktop
  • Launch the app via BankID's recommended anchor-click with referrerPolicy="origin" instead of window.location.href (fixes unreliable iOS universal-link launch)
  • Restrict the manual "start BankID" fallback button to Android browsers that require a user gesture (Chrome, Edge, Samsung Internet, Brave); keep autostart automatic on iOS and on Android Firefox/Opera

These things have been implemented (when relevant)

  • Code written
  • Test added — launcher tests for app-link vs scheme selection, the user-interaction matrix, and redirect parameter behavior (Android redirect=null, iOS Safari return URL, iOS Chrome/Firefox browser scheme, iOS Edge/Opera redirect=null)
  • Documentation updated / written — added a "How the BankID app is launched" section and a mobile browser-support note in bankid.md

Backwards-compatibility note
This PR changes the launch URL selection for several device/browser combinations (no public API changes):

  • CanUseAppLink no longer restricts the app link to Safari-on-iOS and Chrome/Edge-on-Android ≥ 6 — it now applies to every iOS and Android browser. The DeviceOsVersion.MajorVersion >= 6 guard was removed.
    As a result, iOS non-Safari (Chrome, Firefox, Edge, Opera) and Android Firefox/Opera / older Android now receive https://app.bankid.com/… where they previously received bankid:///…. This matches current BankID guidance and should improve reliability.

  • The manual "start BankID" fallback button is now scoped to restricted Android browsers instead of a broader set.
    What consumers should verify: if you relied on the old scheme-based launch for a specific browser, that path changes. Android Firefox/Opera in particular should be verified on real devices, since their historical app-link/intent handling has been inconsistent. Custom IBankIdLauncher / IBankIdSupportedDeviceDetector implementations are unaffected, and the deprecated redirect query parameter is still emitted, so BankID app compatibility is preserved.

urizen-source and others added 4 commits August 20, 2026 08:38
…vice

Keep autostart as default on iOS; limit manual-launch fallback to restricted Android browsers

Restores autostart as the default per BankID's autostart guidance and scopes the user-interaction fallback to Android browsers that block app launch without a user gesture (excluding Firefox/Opera). Keeps the app-link URL and anchor-based launch from #526. Adds launcher tests for URL selection and interaction behavior.

@elinohlsson elinohlsson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good! I will just do some manual testing before merging.

@torselden
torselden marked this pull request as ready for review August 26, 2026 10:51
elinohlsson and others added 3 commits August 26, 2026 14:56
Use the BankID-recommended App Link approach by default, but fall back to the bankid:// scheme for Firefox and Samsung Internet on Android, where App Links do not launch the BankID app in our browser tests.
Document the Android App Link exceptions for Firefox and Samsung Internet, remove outdated IE11/polyfill information, and remove Opera from the verified browser list since the redirect flow is currently not working.
@elinohlsson

elinohlsson commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

I made a couple of changes based on testing the BankID autostart flow across our supported mobile browsers:

  • Keep BankID's recommended App Link approach (https://app.bankid.com/) as the default for mobile.
  • On Android, Firefox and Samsung Internet are explicit exceptions. Our testing shows that the App Link does not launch the BankID app in these browsers, so they fall back to the bankid:/// scheme.
  • I tested reverting the new JavaScript launch implementation to window.location.href, but that did not change the behavior. This suggests the issue is specific to App Link support in these browsers rather than launchBankIdApp().
  • Updated the browser support documentation to describe the Android exceptions.
  • Removed the outdated IE11/polyfill documentation.
  • Removed Opera from the verified browser list for now, since the redirect flow is currently not working there.

With these changes, the BankID launch flow works for all of the Android browsers we currently test before release, as well as all of the iOS browsers we test.

There are still some existing redirect issues that need to be addressed, particularly with Edge, and Opera support needs to be investigated. These issues were present before this PR and are not introduced by these changes, so I suggest we look into them separately in another PR.

@elinohlsson
elinohlsson merged commit 2d210d8 into main Aug 27, 2026
17 checks passed
@elinohlsson
elinohlsson deleted the pr-526-improved branch August 27, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review how Active Login performs autostart of the BankID security application

3 participants