Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cvolny/npm-webauthn-client
Webauthn client leveraging Axios and CBOR encoding.
https://github.com/cvolny/npm-webauthn-client
axios cbor django-rest-framework nodejs npm reactjs webauthn
Last synced: about 14 hours ago
JSON representation
Webauthn client leveraging Axios and CBOR encoding.
- Host: GitHub
- URL: https://github.com/cvolny/npm-webauthn-client
- Owner: cvolny
- License: lgpl-2.1
- Created: 2020-12-15T21:41:45.000Z (about 4 years ago)
- Default Branch: integration
- Last Pushed: 2020-12-16T17:46:09.000Z (about 4 years ago)
- Last Synced: 2024-04-23T08:47:28.290Z (10 months ago)
- Topics: axios, cbor, django-rest-framework, nodejs, npm, reactjs, webauthn
- Language: JavaScript
- Homepage:
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @cvolny/webauthn-client
Webauthn client leveraging Axios and CBOR encoding.I have request/response interceptors set on an axios instance inside of webauthn.js such that
CBOR encoding/decoding is performed for you. I also configured the axios xsrf settings for
the Django web framework default configuration.## Example Usage:
```
import {
webauthn_login,
webauthn_register,
} from "webauthn-client";...
login_passwordless = (username) => {
const success = (res) => this.setState({authenticated: true});
const failure = (res, code) => console.log('webauthn login failed', code, res);
webauthn_login({username: username}, success, failure);
};login_2fa = (username, password) => {
const success = (res) => this.setState({authenticated: true});
const failure = (res, code) => console.log('webauthn login failed', code, res);
webauthn_login({username: username, password: password}, success, failure);
};register = () => {
const success = (res) => console.log('registered!');
const failure = (res, code) => console.log('webauthn registration failed', code, res);
webauthn_register({}, success, failure);
};
```## Notes:
Really any map can be passed for authentication payload (username, password, token, etc).