{"id":24857,"library":"yubico-client","title":"yubico-client","description":"A Python library for verifying YubiKey One Time Passwords (OTPs) via the Yubico validation API. Version 1.13.0 is stable with infrequent releases.","status":"active","version":"1.13.0","language":"python","source_language":"en","source_url":"https://github.com/Kami/python-yubico-client/","tags":["yubico","otp","security","authentication"],"install":[{"cmd":"pip install yubico-client","lang":"bash","label":"stable"}],"dependencies":[],"imports":[{"note":"Standard import path since 1.0.","symbol":"Yubico","correct":"from yubico_client import Yubico"}],"quickstart":{"code":"import os\nfrom yubico_client import Yubico\n\nclient_id = os.environ.get('YUBICO_CLIENT_ID', '')\nsecret_key = os.environ.get('YUBICO_SECRET_KEY', '')\nyubi = Yubico(client_id, secret_key)\notp = 'ccccccbcvghfvbjfbbgvhu'  # example OTP\nif yubi.verify(otp):\n    print('OTP is valid')\nelse:\n    print('OTP verification failed')","lang":"python","description":"Verify a YubiKey OTP using the Yubico validation API."},"warnings":[{"fix":"Update imports to 'from yubico_client import Yubico'.","message":"In version 1.0, the import changed: 'import yubico' no longer works; use 'from yubico_client import Yubico'.","severity":"breaking","affected_versions":">=1.0"},{"fix":"Set environment variables YUBICO_CLIENT_ID and YUBICO_SECRET_KEY.","message":"The library uses the Yubico validation API v2. You must have a client ID and secret key from Yubico. Without them, verify() will raise an exception.","severity":"gotcha","affected_versions":"all"},{"fix":"Use try/except around verify() to get exceptions like YubicoVerificationError.","message":"verify() returns True/False, not a Yubico response object. For detailed failure reasons, catch exceptions from yubico_client.errors.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'1.13.0':20 'api':18 'authent':29 'client':3 'infrequ':24 'librari':6 'one':10 'otp':13,27 'password':12 'python':5 'releas':25 'secur':28 'stabl':22 'time':11 'valid':17 'verifi':8 'version':19 'via':14 'yubico':2,16,26 'yubico-cli':1 'yubikey':9","created_at":"2026-05-01T08:15:17.423535+00:00","updated_at":"2026-05-01T08:15:17.423535+00:00","problems":[{"fix":"Run 'pip install yubico-client' and use 'from yubico_client import Yubico'.","cause":"Installed old 'yubico' package or forgot to install yubico-client.","error":"ImportError: No module named yubico_client"},{"fix":"Change import to 'from yubico_client import Yubico'.","cause":"Used old import 'import yubico' instead of 'from yubico_client import Yubico'.","error":"AttributeError: module 'yubico_client' has no attribute 'Yubico'"},{"fix":"Check YUBICO_CLIENT_ID and YUBICO_SECRET_KEY values. Generate credentials at https://upgrade.yubico.com/getapikey/.","cause":"Invalid client ID or secret key, or missing environment variables.","error":"yubico_client.errors.YubicoVerificationError: No such client"},{"fix":"Ensure OTP is a 44-character string from a YubiKey. Example: 'ccccccbcvghfvbjfbbgvhu'.","cause":"OTP string is malformed or not a valid YubiKey OTP.","error":"yubico_client.errors.YubicoVerificationError: Bad OTP"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.13.0","cli_name":"yubico-client","cli_version":"sh: 1: yubico-client: not found","type":"library","homepage":"https://developers.yubico.com","github":"https://github.com/Kami/python-yubico-client","docs":null,"changelog":null,"pypi":"https://pypi.org/project/yubico-client/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["auth-security","communication"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}