silverstripe / silverstripe-webauthn-authenticator

A Web Authentication (WebAuthn) authenticator for silverstripe/silverstripe-mfa
BSD 3-Clause "New" or "Revised" License
4 stars 3 forks source link

CMS 5 - yubikey registration fails #124

Closed emteknetnz closed 1 year ago

emteknetnz commented 1 year ago

Follow on from https://github.com/silverstripe/silverstripe-webauthn-authenticator/pull/122

When I register for webauthn And I press the yubikey Then I see I Key Verified When I click the "Complete registration" button Then I see this

image

Exception comes from vendor/paragonie/contant_time_encoding/src/Base32.php

Possibly relevant - https://github.com/silverstripe/silverstripe-webauthn-authenticator/pull/122#issuecomment-1386194783

Related https://github.com/silverstripe/silverstripe-webauthn-authenticator/issues/127

Acceptance criteria

PRs

Note

sabina-talipova commented 1 year ago

There is an raised issue about this Error in web-auth/webauthn-framework

One another solution here to downgrade web-auth/webauthn-lib version :

emteknetnz commented 1 year ago

@sabina-talipova That looks promising, makes sense to try to manually remove the padding similar to the laravel example at first, and failing that downgrade to ~4.0.5 - we're currently on ^4.4 - https://github.com/silverstripe/silverstripe-webauthn-authenticator/blob/5/composer.json#L15, though that's less than ideal

emteknetnz commented 1 year ago

Note the latest version of web-auth/webauthn-lib gives a different response - the error is now "Registration failed: Unable to load the data" - this is because of this line https://github.com/web-auth/webauthn-lib/compare/4.4.3...4.5.1#diff-d6efd31abc9f65b2a796aeab582924a819658d2e628e12e5d018c886880d7471R122 - reverting it shows the "padding" message again.

emteknetnz commented 1 year ago

Have confirmed locally that using web-auth/webauthn-lib ~4.0.0 does resolve the issue

maxime-rainville commented 1 year ago

It all works fine.