diff options
author | Matthew Miller <matthew@millerti.me> | 2020-07-20 13:15:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-20 13:15:40 -0700 |
commit | 944dd4d69613d4ebcd34e8b10d8008e9abc7f303 (patch) | |
tree | 7098a2918af1f65806902e72e793435546240f1b /example/index.js | |
parent | 3336c80f9a6472aed2f60b823606be716f3b48a3 (diff) | |
parent | a2f6200a943c7b59d0f3b0c56399c42ab662e9a0 (diff) |
Merge pull request #34 from MasterKale/feature/example-mkcert
feature/example-mkcert
Diffstat (limited to 'example/index.js')
-rw-r--r-- | example/index.js | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/example/index.js b/example/index.js index 2cc3b5b..7921c29 100644 --- a/example/index.js +++ b/example/index.js @@ -39,7 +39,7 @@ app.use(express.json()); * RP ID represents the "scope" of websites on which a authenticator should be usable. The Origin * represents the expected URL from which an attestation or assertion occurs. */ -const rpID = 'dev.yourdomain.com'; +const rpID = 'localhost'; const origin = `https://${rpID}`; /** * 2FA and Passwordless WebAuthn flows expect you to be able to uniquely identify the user that @@ -84,7 +84,7 @@ const loggedInUserId = 'internalUserId'; const inMemoryUserDeviceDB = { [loggedInUserId]: { id: loggedInUserId, - username: 'user@yourdomain.com', + username: 'user@localhost', devices: [ /** * { @@ -272,14 +272,10 @@ https .createServer( { /** - * You'll need to provide a SSL cert and key here because - * WebAuthn can only be run from HTTPS:// URLs - * - * HINT: If you create a `dev` subdomain A-record that points to 127.0.0.1, - * you can manually generate an HTTPS certificate for it using Let's Encrypt certbot. + * WebAuthn can only be run from https:// URLs. See the README on how to generate this SSL cert and key pair using mkcert */ - key: fs.readFileSync('./dev.yourdomain.com.key'), - cert: fs.readFileSync('./dev.yourdomain.com.crt'), + key: fs.readFileSync('./localhost.key'), + cert: fs.readFileSync('./localhost.crt'), }, app, ) |