Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raresail/yubico-otp-client
An offline Client for Yubico OTP
https://github.com/raresail/yubico-otp-client
2fa authenticator client fido fido-u2f fido2 mfa offline otp yubico yubico-otp yubikey yubikey-authenticators
Last synced: about 2 months ago
JSON representation
An offline Client for Yubico OTP
- Host: GitHub
- URL: https://github.com/raresail/yubico-otp-client
- Owner: RaresAil
- License: apache-2.0
- Created: 2023-05-28T10:22:10.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-07-06T06:46:33.000Z (over 1 year ago)
- Last Synced: 2024-10-31T20:09:30.364Z (3 months ago)
- Topics: 2fa, authenticator, client, fido, fido-u2f, fido2, mfa, offline, otp, yubico, yubico-otp, yubikey, yubikey-authenticators
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@raresail/yubico-otp-client
- Size: 94.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @raresail/yubico-otp-client
### An offline Client for Yubico OTP
[![Node.js CI](https://github.com/RaresAil/yubico-otp-client/actions/workflows/node.js.yml/badge.svg)](https://github.com/RaresAil/yubico-otp-client/actions/workflows/node.js.yml)
[![Yarn Audit CI](https://github.com/RaresAil/yubico-otp-client/actions/workflows/audit.yml/badge.svg)](https://github.com/RaresAil/yubico-otp-client/actions/workflows/audit.yml)
[![CodeQL](https://github.com/RaresAil/yubico-otp-client/actions/workflows/codeql.yml/badge.svg)](https://github.com/RaresAil/yubico-otp-client/actions/workflows/codeql.yml)## Installation
### Yarn
```bash
yarn add @raresail/yubico-otp-client
```### NPM
```bash
npm install @raresail/yubico-otp-client
```## Usage
When making the setup for OTP you create a Public ID, a Private ID and a Secret Token.
```ts
import { Token } from '@raresail/yubico-otp-client';const token = new Token('secret', 'private-id', 'public-id');
token.validateCode('code-0'); // return true or false
token.validateCode('code-0'); // will return false if the same code or an older one is used
```