- ColdBox 6+
- cbSecurity 3+
-
Install CBSecurity Passkeys
box install cbsecurity-passkeys -
Add Java libs from cbsecurity-passkeys
this.javaSettings = {
loadPaths : [ "./modules/cbsecurity-passkeys/lib" ],
loadColdFusionClassPath : true,
reloadOnChange : true
};-
Implement the
ICredentialRepositoryinterface. (See an example in/resources/examples/quick/Passkey.cfc) -
Configure your
credentialRepositoryMappinginconfig/ColdBox.cfc
moduleSettings = {
"cbsecurity-passkeys": {
"credentialRepositoryMapping": "Passkey"
}
}- Configure at least one (1)
allowedOrigins
moduleSettings = {
"cbsecurity-passkeys": {
"credentialRepositoryMapping": "Passkey",
"allowedOrigins": [ "example.com" ]
}
}Integrate using the includes/passkeys.js library:
<script src="/modules/cbsecurity-passkeys/includes/passkeys.js"></script>
<script type="module">
if ( await window.cbSecurity.passkeys.isSupported() ) {
await window.cbSecurity.passkeys.register(
// redirectLocation ("/")
);
}
</script>
<script type="module">
if ( await window.cbSecurity.passkeys.isSupported() ) {
await window.cbSecurity.passkeys.login(
// username (optional)
// redirectLocation ("/")
// additionalParams ({})
)
}
</script>
<script>
window.cbSecurity.passkeys.autocomplete(
// redirectLocation ("/")
// additionalParams ({})
);
</script>