An open API service indexing awesome lists of open source software.

https://github.com/coldbox-modules/cbsecurity-passkeys

Passkey support for cbSecurity and ColdBox applications
https://github.com/coldbox-modules/cbsecurity-passkeys

Last synced: 6 months ago
JSON representation

Passkey support for cbSecurity and ColdBox applications

Awesome Lists containing this project

README

          

# CBSecurity Passkeys

## Requirements
- ColdBox 6+
- cbSecurity 3+

## Installation

1. Install CBSecurity Passkeys
`box install cbsecurity-passkeys`

2. Add Java libs from cbsecurity-passkeys
```js
this.javaSettings = {
loadPaths : [ "./modules/cbsecurity-passkeys/lib" ],
loadColdFusionClassPath : true,
reloadOnChange : true
};
```

3. Implement the `ICredentialRepository` interface. (See an example in `/resources/examples/quick/Passkey.cfc`)

4. Configure your `credentialRepositoryMapping` in `config/ColdBox.cfc`
```js
moduleSettings = {
"cbsecurity-passkeys": {
"credentialRepositoryMapping": "Passkey"
}
}
```

5. Configure at least one (1) `allowedOrigins`
```js
moduleSettings = {
"cbsecurity-passkeys": {
"credentialRepositoryMapping": "Passkey",
"allowedOrigins": [ "example.com" ]
}
}
```

Integrate using the `includes/passkeys.js` library:

```html

if ( await window.cbSecurity.passkeys.isSupported() ) {
await window.cbSecurity.passkeys.register(
// redirectLocation ("/")
);
}

if ( await window.cbSecurity.passkeys.isSupported() ) {
await window.cbSecurity.passkeys.login(
// username (optional)
// redirectLocation ("/")
// additionalParams ({})
)
}

window.cbSecurity.passkeys.autocomplete(
// redirectLocation ("/")
// additionalParams ({})
);

```