{"id":16897109,"url":"https://github.com/kami/node-yubico","last_synced_at":"2025-06-22T23:04:24.844Z","repository":{"id":1265248,"uuid":"1204248","full_name":"Kami/node-yubico","owner":"Kami","description":"Node library for validating Yubikey One Time Passwords (OTPs) based on the validation protocol version 2.0.","archived":false,"fork":false,"pushed_at":"2017-05-22T19:30:48.000Z","size":83,"stargazers_count":26,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-20T14:43:44.340Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kami.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-12-28T22:26:34.000Z","updated_at":"2022-10-03T11:55:36.000Z","dependencies_parsed_at":"2022-08-16T12:50:23.224Z","dependency_job_id":null,"html_url":"https://github.com/Kami/node-yubico","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Kami/node-yubico","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kami%2Fnode-yubico","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kami%2Fnode-yubico/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kami%2Fnode-yubico/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kami%2Fnode-yubico/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kami","download_url":"https://codeload.github.com/Kami/node-yubico/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kami%2Fnode-yubico/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261380899,"owners_count":23149963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T17:35:04.291Z","updated_at":"2025-06-22T23:04:19.823Z","avatar_url":"https://github.com/Kami.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yubico\nNode library for validating Yubico One Time Passwords (OTPs) based on the [validation protocol version 2.0](http://code.google.com/p/yubikey-val-server-php/wiki/ValidationProtocolV20).\n\n# Installation\n\n    npm install yubico\n\n# Build Status\n\n[![Build Status](https://secure.travis-ci.org/Kami/node-yubico.png)](http://travis-ci.org/Kami/node-yubico)\n\n# Usage\n\nCreate a new instance of the Yubico object and call `verify()` or `verify_multi()` method.\n\n    var yubico = new Yubico(client_id, api_key, use_https)\n\nParameters:\n\n* `client_id` - client id\n* `key` - API key (optional)\n* `use_https` true to use https (defaults to `true`)\n\nResponse message HMAC signature is only verified if an API key is provided so you are encouraged to provide it.\n\nYou can get both client_id and the api key at [https://upgrade.yubico.com/getapikey/](https://upgrade.yubico.com/getapikey/).\n\n## Validating a single token\n\n    yubico.verify(otp_token, timeout, callback)\n\nParameters:\n\n* `otp` - token generated by the Yubikey\n* `timeout` - connection timeout in seconds (defaults to 15 seconds)\n* `callback` - a callback which is called with an error as the first argument if the Yubikey validation fails and `true` as the second one if the provided token is valid.\n\n## Validating multiple tokens\n\n    yubico.verify_multi(otp_list, max_time_window, timeout, callback)\n\n* `otp_list` - an array of Yubikey tokens. Tokens are validated in the provided order so the order matters (tokens must be provided in the same order as they were generated)\n* `max_time_window` - how many seconds can pass between the first token and the last token generation so that the result is still considered valid (defaults to 5 seconds)\n* `timeout` - connection timeout in seconds (defaults to 15 seconds)\n* `callback` - a callback which is called with an error as the first argument if the Yubikey validation fails and `true` as the second one if the provided token is valid.\n\n# Example\n\nExample is located in `example/example.js`.\n\n## Validating a single token (example)\n\n    node example/example.js single client_id [secret_key|null] otp\n\n## Validating multiple tokens (example)\n\n    node example/example.js multi client_id [secret_key|null] otp_1 otp_2\n\n# History\n\n02.02.2010 - v0.1.2:\n\n* Allow package to be used with node \u003e= 0.3.0\n* Don't use https if node version \u003e= 0.3.0 or use_https equals False\n* Update tests so it works with a new version of expresso\n\n31.12.2010 - v0.1.1:\n\n* Verify time window in the multi mode\n* Throw exception if none or only a single token is provided in the multi mode\n* Always take \"max_time_window\" argument in seconds and convert it internally\n* Add tests\n\n28.12.2010 - v0.1.0:\n\n* Initial release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkami%2Fnode-yubico","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkami%2Fnode-yubico","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkami%2Fnode-yubico/lists"}