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

Cannot register Yubikey with Chrome #116

Closed
norbusan opened this issue Mar 19, 2016 · 9 comments
Closed

Cannot register Yubikey with Chrome #116

norbusan opened this issue Mar 19, 2016 · 9 comments

Comments

@norbusan
Copy link

Hi,

I am trying to register my yubikey neo with the plugin, but then clicking on "New" it an instant it changes to "Failed" without me doing anything.

I am running chrome 49, and verified on the yubico test site that the key can be used with this browser.

OS is Debian/unstable.

Thanks

@kasparsd
Copy link
Collaborator

U2F requires HTTPS. Do you have that?

@lazyrivr
Copy link

I've gotten the same thing on a couple of my Wordpress sites (though not all), and all of them have HTTPS. I'm running Chrome 49 on Windows 10.

All the sites I'm having trouble with have been around for a while, and have/had several plugins, so I think it might be some kind of plugin conflict. Interestingly, they have all had other two-factor plugins previously as well - either Google Authenticator or Authy - so maybe it's related somehow.

@lazyrivr
Copy link

I retract my previous theory - it turns out the answer is much simpler than that (at least for my situation).

I noticed closed issue #89 that was very similar, and, based on the comments there, checked out the console. That's when I noticed it:

sign Object {version: "U2F_V2", challenge: "rw1XSYbsNrMP8l6B-P6khCKb7acUQsyuTP0lUdqeA8c", appId: "http://www.andy-bell.com"}
Register callback Object {errorCode: 2} Window {external: Object, chrome: Object, document: document, ajaxurl: "/wp-admin/admin-ajax.php", pagenow: "profile"…}
Registration Failed 2

The appId was just http, not https. Back when I converted all my sites to HTTPS, I did so with server redirects. In doing so, I forgot to go to the General Settings in WordPress and change the WordPress Address and Site Address URLs to https.

I went in, changed those settings, and tried adding the U2F key again, and it worked - on all 4 sites that it wasn't working on before. WordPress in general had been working fine with just the server redirects for over a year, but that little oversight seems to be what caused U2F to fail.

@norbusan
Copy link
Author

Bingo!
I can confirm that. But I still consider it a bug.
I think it is quite common to have the main site on http, but use admin only over https.

Thanks for your research!

Norbert

@norbusan
Copy link
Author

One more thing: After changing the http to https, and unconditionally returning true in providers/class.two-factor-fido-u2f.php, function is_browser_support, I can use the yubikey also with firefox and the u2f addon: https://addons.mozilla.org/en-US/firefox/addon/u2f-support-add-on/

So it would be nice if this would be supported from the plugin out of the box.

@kasparsd
Copy link
Collaborator

Thanks for confirming the HTTPS issue @norbusan!

Closing as a duplicate of #79.

@norbusan
Copy link
Author

Thanks - any chance on the firefox extension plugin support?

@kasparsd
Copy link
Collaborator

@norbusan Sure, I created a new issue for that #117.

@norbusan
Copy link
Author

Thanks!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants