Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android WebView Support WebAuthn?

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!

like image 655
Priyanka Avatar asked May 22 '19 13:05

Priyanka


People also ask

Does WebView support WebAuthn?

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.

Which browser is used in Android WebView?

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.

Is Android WebView deprecated?

This interface was deprecated in API level 12. This interface is now obsolete.

Does Fido support Android?

The FIDO2 API allows Android applications to create and use strong, attested public key- based credentials for the purpose of authenticating users.


1 Answers

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.

like image 171
Tangui Avatar answered Oct 10 '22 07:10

Tangui