I am not an android developer and stuck at an android thing. I hope someone here can help me out.
I am implementing WebAuthn/FIDO2 on my website, which is working perfectly fine with the browsers. But when I open my website in my android app (android.webkit.webview), it gives me the error
I/chromium: [INFO:CONSOLE(136)] "Got error-NotSupportedError: The user agent does not support public key credentials."
Code sample which I am using in my website is something like:
navigator.credentials.create({ publicKey })
Opening https://webauthn.io/ in my app, says "this browser isn't currently supported"
Can't we update webView somehow?
I am using sdk version (API 26,Android 8.0 oreao)
Is there any workaround?
Thanks in advance!
Simply put: it is not and won't be implemented in Android Webview (source), for security reasons. So as to use WebAuthn from your application, you have to redirect to the browser, either directly or using SFSafariViewController (iOS) or Android Custom Tab (Android) as explained in RFC8252 - Appendix B.
The WebView class is an extension of Android's View class that allows you to display web pages as a part of your activity layout. Since Android 4.4, it is based on the Chrome on Android v33.
This interface was deprecated in API level 12. This interface is now obsolete.
The FIDO2 API allows Android applications to create and use strong, attested public key- based credentials for the purpose of authenticating users.
Simply put: it is not and won't be implemented in Android Webview (source), for security reasons.
So as to use WebAuthn from your application, you have to redirect to the browser, either directly or using SFSafariViewController (iOS) or Android Custom Tab (Android) as explained in RFC8252 - Appendix B.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With