IamSAL / webauthn

MIT License
7 stars 1 forks source link

Problem testing in local dev environment #1

Open sridhardev07 opened 2 years ago

sridhardev07 commented 2 years ago

Hi, first of all thanks for the wonderful example for webauthn. I want to try that in my phone, but there is a problem while accessing the client using ip address instead of localhost, so I made the change while running the client by adding the host as '0.0.0.0' in webpack.config.js under devServer:, but the problem is that whenever I tried to run it using localhost it works fine but when I tried to open it using ip address even 127.0.0.1 or 0.0.0.0 it shows error on navigator.create undefined, I also downloaded one more repo which is frontend only, it also behaves same, do you know the reason behind this?

IamSAL commented 2 years ago

Hi,

This feature is available only in secure contexts (HTTPS) and it works in localhost(even though its not https) because localhost is considered a secure context.

if you want to access by ip or domain, you have to host it in a server and make sure its access by https:// protocol.

I personally tested it by hosting in vps and connecting a domain with https.

thanks

sridhardev07 commented 2 years ago

Hi @IamSAL thanks for the response, I will try that. You have a some experience in fido, I am new to this so I have few question if you can answer?

  1. I want to implement it in app, so is there any library to implement it in React Native.
  2. Is there any way to read and write some data on fido device apart from the private key that can be read and write when connected to device. As I want to store some encrypted string in it which is a welcome message unique for every user and on login I want to fetch it from fido device decrypt it and show it to the user, is it possible.

Thanks!