Autocomplete issue
Describe the issue
I am trying to enable autocomplete, so my html looks like this:
<div id="credentials-wrapper">
<label style="width: 100%">
Username<br />
<input
id="username"
type="text"
class="wide"
name="username"
autocomplete="username webauthn"
/>
</label>
<div class="password">
<label style="width: 100%">
Password
<input
id="password"
type="password"
class="wide"
name="password"
autocomplete="password webauthn"
/>
</label>
</div>
<div id="check-cred-wrapper">
<label id="remember-me-label">
<input
name="rememberme"
type="checkbox"
id="rememberme"
value="forever"
checked=""
/>
Remember Me
</label>
</div>
</div>
Then in my js i do this:
const assertionResponse = await startAuthentication({ optionsJSON: options, useBrowserAutofill: true });
But I have two problems:
- The autocomplete does not work in Chrome, Firefox or Edge, it does not request for webauthn
- If I have autocomple on the whole startAuthentication request does not work. On line 57 of the startAuthencation.js file
getOptions.mediation = 'conditional';is runned. Which causescredential = (await navigator.credentials.get(getOptions));to never return. If I remove the mediation property everything works fine.
Reproduction Steps
- Enable autocomplete
- try to do webauthn
Expected behavior
I should see a webauthn selector as soon as I click on the username or password field. I should be able to run credential = (await navigator.credentials.get(getOptions)); without problems
Code Samples + WebAuthn Options and Responses
Dependencies
- Windows 11
- Chrome Version 142.0.7444.176 (Official Build) (64-bit), Firefox 146.0 (64-bit), Edge Version 143.0.3650.66 (Official build) (64-bit)
- Windows Hello
And iOS 18.6.2 Safari buildin password thing
SimpleWebAuthn Libraries
@simplewebauthn/[email protected]
Additional context
The autocomplete does not work in Chrome, Firefox or Edge, it does not request for webauthn
Hello @Tsjippy can you please fill out the Dependencies section of the PR template? OS and browser versions will factor into any potential advice I might have for you here.
The autocomplete does not work in Chrome, Firefox or Edge, it does not request for webauthn
Hello @Tsjippy can you please fill out the Dependencies section of the PR template? OS and browser versions will factor into any potential advice I might have for you here.
Thanks for your reply. I have filled it in now.
you can check on simnigeria,org, but I have changed this
//const assertionResponse = await startAuthentication({ optionsJSON: options, useBrowserAutofill: true });
const assertionResponse = await startAuthentication({ optionsJSON: options });
otherwise people cannot login