https://github.com/thomastjdev/nim_yubikey_otp
https://github.com/thomastjdev/nim_yubikey_otp
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/thomastjdev/nim_yubikey_otp
- Owner: ThomasTJdev
- License: mit
- Created: 2025-01-02T13:01:28.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-11T14:55:10.000Z (over 1 year ago)
- Last Synced: 2025-03-06T04:20:42.719Z (over 1 year ago)
- Language: Nim
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yubikey_otp
For general information see:
* https://developers.yubico.com/OTP/OTP_Walk-Through.html
* https://developers.yubico.com/yubikey-val/Validation_Protocol_V2.0.html
* https://docs.yubico.com/yesdk/users-manual/application-otp/yubico-otp.html
* https://upgrade.yubico.com/getapikey/
This is a simple api call and validator for the yubikey's OTP.
## 1. Set up
Go to `https://upgrade.yubico.com/getapikey/` and get an API key. Save the
clientID.
## 2. Register user on
```nim
let
clientID =
otp =
let
data = yubikeyRegister(clientID, otp)
if data.success:
# Save the `data.publicID` to the database and associate it with the user
else:
# Handle the error
```
## 3. Validate on login
```nim
let
clientID =
publicID =
otp =
if yubikeyValidate(clientID, publicID, otp):
# Success
else:
# Failure
```