Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work on Chrome browser on Android #138

Closed
hDmtP opened this issue Aug 21, 2022 · 11 comments
Closed

Doesn't work on Chrome browser on Android #138

hDmtP opened this issue Aug 21, 2022 · 11 comments

Comments

@hDmtP
Copy link

hDmtP commented Aug 21, 2022

It works completely fine on my pc (both Chrome and Firefox) but says Browser not supported when I try to register/authenticate in Android chrome.

Screenshot_2022_0821_161657.jpg

@MasterKale
Copy link
Collaborator

Can you share the entirety of Registration Options? If you're requesting resident key with residentKey: "required" that's likely why, discoverable credentials aren't supported on Android right now.

@hDmtP
Copy link
Author

hDmtP commented Aug 29, 2022

Registration Raw Output

// Registration Options
{
  "rp": {
    "name": "Sample RP",
    "id": "localhost"
  },
  "user": {
    "id": "REDACTED by me",
    "name": "your.name@localhost",
    "displayName": "your.name@localhost"
  },
  "challenge": "REDACTED by me",
  "pubKeyCredParams": [
    {
      "type": "public-key",
      "alg": -7
    },
    {
      "type": "public-key",
      "alg": -257
    }
  ],
  "attestation": "none",
  "timeout": 60000,
  "excludeCredentials": [],
  "authenticatorSelection": {
    "requireResidentKey": false,
    "userVerification": "required"
  }
}


Authentication Raw Output

// Authentication Options
{
  "challenge": "REDACTED by me",
  "allowCredentials": [],
  "userVerification": "required",
  "timeout": 60000,
  "rpId": "localhost"
}

@MasterKale
Copy link
Collaborator

I just realized you're testing with https://github.com/duo-labs/duo-blog-going-passwordless-with-py-webauthn! That's why it looks so familiar.

Error: WebAuthn is not supported in this browser

This is almost definitely @simplewebauthn/browser detecting that WebAuthn is not supported. See this line in startRegistration() that throws an error with this exact wording:

https://github.com/MasterKale/SimpleWebAuthn/blob/master/packages/browser/src/methods/startRegistration.ts#L24

Since the code otherwise works fine, you're running into an Android issue, as opposed to anything wrong with py_webauthn.

@hDmtP
Copy link
Author

hDmtP commented Aug 30, 2022

I see.

So what should I do for Android?

@MasterKale
Copy link
Collaborator

So what should I do for Android?

The general answer here is to make sure your OS and apps are all up on date. I'm not sure when Android started supporting WebAuthn, though, so I don't have a good idea of a minimum version of Android to aim for.

I'm curious, what version of Android and what make and model of device are you testing with? And what version of Chrome for that matter?

@MasterKale
Copy link
Collaborator

I asked around, it seems Android 8 is the earliest version of Android with any WebAuthn support.

@hDmtP
Copy link
Author

hDmtP commented Aug 31, 2022

I'm curious, what version of Android and what make and model of device are you testing with? And what version of Chrome for that matter?

Android 12
vivo 1915
Chrome version = 104.0.5112.97 (32-bit)

@ryou90
Copy link

ryou90 commented Aug 31, 2022

Hi,
I also use the combination of py_webauthn for server part and @simplewebauthn/browser for the browser implementation.
For me it runs fine in Chrome on Android, edge and firefox.

I also have requireResidentKey enabled without problems.

Do you use https (ssl) ? Webauthn doesn't work on http, when the host is not localhost. Then https is required!

See here

Note: Both create() and get() require a secure context (i.e. the server is connected by HTTPS or is the localhost), and will not be available for use if the browser is not operating in a secure context..

@MasterKale
Copy link
Collaborator

Android 12
vivo 1915
Chrome version = 104.0.5112.97 (32-bit)

@hDmtP I'm curious, if you go to https://webauthn.io on that phone, do you see a message like this?

Screen Shot 2022-08-31 at 4 33 30 PM

Could be the phone just doesn't support WebAuthn, for some reason. I would have no idea how to fix it, that's way outside the scope of this repo.

Do you use https (ssl) ? Webauthn doesn't work on http, when the host is not localhost. Then https is required!

@ryou90 is correct, you can only use WebAuthn in a Secure Context. That is, you must use either http://localhost or something served at https:// to ensure the webpage has access to WebAuthn. Can you confirm that you're accessing that site in your original screenshot over an https:// connection on your phone?

@hDmtP
Copy link
Author

hDmtP commented Sep 1, 2022

I think @ryou90 is right. I was running that on localhost all this time.

And yes, https://webauthn.io/ does work on my phone

Screenshot_2022_0901_113001.jpg

@hDmtP hDmtP closed this as completed Sep 1, 2022
@Cyrille37
Copy link

Cyrille37 commented Nov 21, 2024

With a Samsung A41 Android 12 with Chrome 128 & Firefox 132

The "register" does not work, it throw "The operation either timed out or was not allowed." at https://webauthn.io/ either on https://www.passkeys.io/, https://webauthn.me/

We talk about at duo-labs/webauthn.io#146

update: It works with Samsung and Android 14.

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

No branches or pull requests

4 participants