Skip to main content

Python Yubico Client

Project description

# Yubico Python Client

Python class for verifying Yubico One Time Passwords (OTPs) based on the validation protocol version 2.0.

## Installation

pip install yubico

## Build Status

[![Build Status](https://secure.travis-ci.org/Kami/python-yubico-client.png)](http://travis-ci.org/Kami/python-yubico-client)

## Running Tests

python setup.py test

## Usage

  1. Generate your client id and secret key (this can be done by visiting the [Yubico website](https://api.yubico.com/get-api-key/))

  2. Use the client

Single mode:

from yubico.yubico import Yubico

yubico = Yubico(‘client id’, ‘secret key’) yubico.verify(‘otp’)

Multi mode:

from yubico.yubico import Yubico

yubico = Yubico(‘client id’, ‘secret key’) yubico.verify_multi([‘otp 1’, ‘otp 2’, ‘otp 3’])

The verify method will return True if the provided OTP is valid (STATUS=OK).

The verify_multi method will return True if all of the provided OTPs are valid (STATUS=OK).

Both methods can also throw one of the following exceptions:

  • StatusCodeError - server returned REPLAYED_OTP status code

  • SignatureVerificationError - server response message signature verification failed

  • InvalidClientIdError - client with the specified id does not exist (server returned NO_SUCH_CLIENT status code)

  • Exception - server returned one of the following status values: BAD_OTP, BAD_SIGNATURE, MISSING_PARAMETER, OPERATION_NOT_ALLOWED, BACKEND_ERROR, NOT_ENOUGH_ANSWERS, REPLAYED_REQUEST or no response was received from any of the servers in the specified time frame (default timeout = 10 seconds)

[1]: http://www.yubico.com [2]: http://www.yubico.com/developers/intro/ [3]: http://www.yubico.com/develop/open-source-software/web-api-clients/server/ [4]: https://github.com/Yubico/yubikey-val/wiki/ValidationProtocolV20

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yubico-1.6.1.tar.gz (14.4 kB view details)

Uploaded Source

File details

Details for the file yubico-1.6.1.tar.gz.

File metadata

  • Download URL: yubico-1.6.1.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for yubico-1.6.1.tar.gz
Algorithm Hash digest
SHA256 51dfca2141ae11b2e9adb417cfc727ea6af3be877124fd2acb74c7370fc749bc
MD5 79f1a542a8d2ae08e2b67a66f2a9893b
BLAKE2b-256 1522bc3d474cdb4b5d55a09f232a9d4f4ad82d8df088f8ec3d2317ad03ed1725

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page