summaryrefslogtreecommitdiffhomepage
path: root/example/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'example/index.js')
-rw-r--r--example/index.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/example/index.js b/example/index.js
index a8b8afa..0254e71 100644
--- a/example/index.js
+++ b/example/index.js
@@ -18,8 +18,26 @@ const {
// Login ("Assertion")
generateAssertionOptions,
verifyAssertionResponse,
+ // Support for FIDO MDS
+ MetadataService,
} = require('@simplewebauthn/server');
+/**
+ * Initialize MetadataService to enable support for the FIDO Metadata Service. Metadata enables
+ * a greater degree of certainty that the devices interacting with this server are what they claim
+ * to be according to their manufacturer.
+ *
+ * Use of MetadataService is _not_ required to use @simplewebauthn/server. If you do choose to use
+ * it, you'll need to set the following environment variables (.env files are supported):
+ *
+ * ENABLE_MDS=true
+ * MDS_API_TOKEN=YourFIDOAccessTokenGoesHere
+ *
+ * See https://mds2.fidoalliance.org/tokens/ to register for a free access token. When they ask for
+ * an Organization Name, "Self" works just fine.
+ */
+MetadataService.initialize();
+
const app = express();
const host = '0.0.0.0';
const port = 443;