Coder Social home page Coder Social logo

chrmorais / pyu2f Goto Github PK

View Code? Open in Web Editor NEW

This project forked from google/pyu2f

0.0 1.0 0.0 51 KB

pyu2f is a python based U2F host library for Linux, Windows, and MacOS. It provides functionality for interacting with a U2F device over USB.

License: Apache License 2.0

Python 100.00%

pyu2f's Introduction

pyu2f

pyu2f is a python based U2F host library for Linux, Windows, and MacOS. It provides functionality for interacting with a U2F device over USB.

Features

pyu2f uses ctypes to make system calls directly to interface with the USB HID device. This means that no platform specific shared libraries need to be compiled for pyu2f to work.

By default pyu2f will use its own U2F stack implementation to sign requests. If desired, pyu2f can offload signing to a pluggable command line tool. Offloading is not yet supported for U2F registration.

Usage

The recommended approach for U2F signing (authentication) is through the convenience interface:

from pyu2f import model
from pyu2f.convenience import authenticator

...

registered_key = model.RegisteredKey(b64_encoded_key)
challenge_data = [{'key': registered_key, 'challenge': raw_challenge_data}]

api = authenticator.CreateCompositeAuthenticator(origin)
response = api.Authenticate(app_id, challenge_data)

See baseauthenticator.py for interface details.

Authentication Plugin

The convenience interface allows for a pluggable authenticator to be defined and used instead of the built in U2F stack.

This can be done by setting the SK_SIGNING_PLUGIN environment variable to the plugin tool. The plugin tool should follow the specification detailed in customauthenticator.py

If SK_SIGNING_PLUGIN is set, the convenience layer will invoke the signing plugin whenver Authenticate() is called.

pyu2f's People

Contributors

svalentin avatar jiangk avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.