{"id":13648357,"url":"https://github.com/Yubico/python-u2flib-server","last_synced_at":"2025-04-22T07:31:17.434Z","repository":{"id":14065133,"uuid":"16768410","full_name":"Yubico/python-u2flib-server","owner":"Yubico","description":"Python based U2F server library","archived":true,"fork":false,"pushed_at":"2020-11-03T12:03:19.000Z","size":286,"stargazers_count":287,"open_issues_count":8,"forks_count":65,"subscribers_count":61,"default_branch":"master","last_synced_at":"2024-03-14T22:10:06.555Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://developers.yubico.com/python-u2flib-server","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Yubico.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-12T13:43:31.000Z","updated_at":"2024-03-14T22:10:06.555Z","dependencies_parsed_at":"2022-09-07T01:13:28.840Z","dependency_job_id":null,"html_url":"https://github.com/Yubico/python-u2flib-server","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yubico%2Fpython-u2flib-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yubico%2Fpython-u2flib-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yubico%2Fpython-u2flib-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yubico%2Fpython-u2flib-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yubico","download_url":"https://codeload.github.com/Yubico/python-u2flib-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250195033,"owners_count":21390230,"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-08-02T01:04:10.456Z","updated_at":"2025-04-22T07:31:17.188Z","avatar_url":"https://github.com/Yubico.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"== u2flib-server\nProvides functionality for working with the server side aspects of the U2F\nprotocol as defined in the link:http://fidoalliance.org/specifications/download[FIDO specifications].\nIt supports Python 2.7, Python 3.3+ and PyPy 2.7+.\n\nNOTE: This project is deprecated and new features will not be added. Please see\nhttps://developers.yubico.com/python-fido2/[python-fido2] which replaces this\nproject.\n\nTo read more about U2F and how to use a U2F library, visit\nlink:http://developers.yubico.com/U2F[developers.yubico.com/U2F].\n\n=== Dependencies\nu2flib-server depends on link:https://pypi.python.org/pypi/cryptography[cryptography],\nwhich requires libffi, OpenSSL, and a C compiler to build.\nOn a Debian or Ubuntu system, the build dependencies can be installed with\nthe following command:\n\n  $ sudo apt-get install build-essential libssl-dev libffi-dev python-dev\n\nFor Windows the cryptography project provides prebuilt wheels.\nFor other platforms refer to link:https://cryptography.io/en/stable/installation/[cryptography installation].\n\n=== Installation\nu2flib-server is installable by running the following command:\n\n  $ pip install python-u2flib-server\n\n==== Check out the code\nRun these commands to check out the source code:\n\n  git clone https://github.com/Yubico/python-u2flib-server.git\n  cd python-u2flib-server\n  git submodule init\n  git submodule update\n\n==== Build a source release\nTo build a source release tar ball, run this command:\n\n  python setup.py sdist\n\nThe resulting build will be created in the dist/ subdirectory.\n\n=== Example\nSee `examples/u2f_server.py` for a working example of a HTTP server for\nU2F enrollment and authentication. `u2f_server.py` can be run as a stand-alone\nserver, and can be used to test a U2F client implementation, such as\npython-u2flib-host, using for example cURL.\n\nThe examples below show cURL command to register a U2F device, and to\nauthenticate it.\n\n==== Registration\nRegistration is initiated by sending a request to the server:\n\n----\n$ curl http://localhost:8081/enroll\n{\"appId\": \"http://localhost:8081\", \"registeredKeys\": [], \"registerRequests\": [{\"version\": \"U2F_V2\", \"challenge\": \"9TCtiRRLBFqMokOWfepjej99lMKQhZfm20Sgtay-FMs\"}]}\n----\nThe RegisterRequest data is then fed to the U2F client, resulting in the\nRegisterResponse data, which is passed back to the server:\n----\n$ curl http://localhost:8081/bind -d'data={\"registrationData\": \"BQQNSrGo5bCdPyQNh1etGjidrJPBwTqittKe5DgKWyumIuGSnQxIHzM8Xd9W2eBrAJezRf7nIbxVRYkiA2G_teiEQLJa3tSyM-irgZHNXwsHC-YnfpXJ_uQkRMsgx37oAefHJI3RsBe4yCN2noa-jO1mgtgRrPK405QdcpI7xVk3XmAwggGHMIIBLqADAgECAgkAmb7osQyi7BwwCQYHKoZIzj0EATAhMR8wHQYDVQQDDBZZdWJpY28gVTJGIFNvZnQgRGV2aWNlMB4XDTEzMDcxNzE0MjEwM1oXDTE2MDcxNjE0MjEwM1owITEfMB0GA1UEAwwWWXViaWNvIFUyRiBTb2Z0IERldmljZTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABDvhl91zfpg9n7DeCedcQ8gGXUnemiXoi-JEAxz-EIhkVsMPAyzhtJZ4V3CqMZ-MOUgICt2aMxacMX9cIa8dgS2jUDBOMB0GA1UdDgQWBBQNqL-TV04iaO6mS5tjGE6ShfexnjAfBgNVHSMEGDAWgBQNqL-TV04iaO6mS5tjGE6ShfexnjAMBgNVHRMEBTADAQH_MAkGByqGSM49BAEDSAAwRQIgXJWZdbvOWdhVaG7IJtn44o21Kmi8EHsDk4cAfnZ0r38CIQD6ZPi3Pl4lXxbY7BXFyrpkiOvCpdyNdLLYbSTbvIBQOTBEAiBs0qu8RRZDf4qJo5qnHOd6hNDu9aEyNGQCeHp47D6-9gIgST3rq1JrUn_xvPh5AAGsn64cLvJlF_V0MF2A73tkLOc\", \"clientData\": \"eyJvcmlnaW4iOiAiaHR0cDovL2xvY2FsaG9zdDo4MDgxIiwgImNoYWxsZW5nZSI6ICI5VEN0aVJSTEJGcU1va09XZmVwamVqOTlsTUtRaFpmbTIwU2d0YXktRk1zIiwgInR5cCI6ICJuYXZpZ2F0b3IuaWQuZmluaXNoRW5yb2xsbWVudCJ9\",\"version\":\"U2F_V2\"}'\ntrue\n----\nThe result, \"true\", indicates that registration was successful.\n\n==== Authentication\nAuthentication for a previously registered U2F device is done by sending a\nrequest to the server:\n\n----\n$ curl http://localhost:8081/sign\n{\"appId\": \"http://localhost:8081\", \"registeredKeys\": [{\"version\": \"U2F_V2\", \"appId\": \"http://localhost:8081\", \"keyHandle\": \"slre1LIz6KuBkc1fCwcL5id-lcn-5CREyyDHfugB58ckjdGwF7jII3aehr6M7WaC2BGs8rjTlB1ykjvFWTdeYA\"}], \"challenge\": \"FnueX-NpT9kB7I41dc8DvPXU1-yj7oO_cBT3e9PWOAw\"}\n----\nThe AuthenticateRequest data is then fed to the U2F client, resulting in an\nAuthenticateResponse object which is passed back to the server:\n----\n$ curl http://localhost:8081/verify -d'data={\"keyHandle\": \"slre1LIz6KuBkc1fCwcL5id-lcn-5CREyyDHfugB58ckjdGwF7jII3aehr6M7WaC2BGs8rjTlB1ykjvFWTdeYA\", \"signatureData\": \"AQAAAAEwRgIhALhe7LTwnBHTPQQIGbn_wPR80S7-HPPliZh966vL3VeiAiEA35w-BVDROwdLGlztLgejw9bnXSrYY0-3EC-_qhi0XaI\", \"clientData\": \"eyJvcmlnaW4iOiAiaHR0cDovL2xvY2FsaG9zdDo4MDgxIiwgImNoYWxsZW5nZSI6ICJGbnVlWC1OcFQ5a0I3STQxZGM4RHZQWFUxLXlqN29PX2NCVDNlOVBXT0F3IiwgInR5cCI6ICJuYXZpZ2F0b3IuaWQuZ2V0QXNzZXJ0aW9uIn0\"}'\n{\"touch\": 1, \"counter\": 1}\n----\nThe response indicates success, giving the U2F devices internal counter value,\nas well as the value of the user presence parameter.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYubico%2Fpython-u2flib-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FYubico%2Fpython-u2flib-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYubico%2Fpython-u2flib-server/lists"}