Skip to content

snakaya/WebAuthn-practice

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebAuthn-practice

License

WebAuthn-practice works as WebAuthn/FIDO2 RP Server and can be used as testing tool for WebAuthn Authenticator and Client. i.e.) Windows10 Edge, Chrome, Firefox and macOS Touch Id, Android Chrome.

The app outputs and records logs of Attestation and Assertion's Response and Options.

If you are WebAuthn/FIDO2 developer, Their output and logs will be useful well.

Feature

  • Registration(Attestation) and Authentication(Assertion).
    • Support Attestation Statement Type ('packed(Basic and Self)', 'android-saftynet', 'fido-u2f' and 'none', expect 'tpm', 'android-key' and 'packed(ECDAA)').
    • Support signature algorithm EC256 and RS256.
  • Change request options(Credential and Assertion).
  • Register users with credential info.
  • Records Attestation Response and View details.

Requirement

  • python >=2.7 + Flask >=1.0.2 (Not support python3 yet)

[NOTICE] WebAuthn RP Server need HTTPS Web server as FrontEnd. Because of WebAuthn's security cause. You MUST setup HTTPS Web server (i.e. Nginx, Apache httpd) after setting RP server up.

Target OS/Browser and Devices

  • Windows10 >= 1809
    • Browser
      • Edge
      • Chrome >= 70
      • Firefox >= 63
    • Devices
      • Face-Camera and Fingerprint-Sensor on Windows Hallo
      • YubiKey
      • FIDO U2F Security Key
  • macOS >= 10.14
    • Browser
      • Chrome >= 70
      • Firefox >= 63
    • Devices
      • TouchID
      • YubiKey
      • FIDO U2F Security Key
  • Android >= N
    • Browser
      • Chrome >= 70
    • Devices
      • Fingerprint-Sensor
      • YubiKey
      • FIDO U2F Security Key

I do not guarantee of a suitable operation at all.

Basic Installation

1.Download source from GitHub to your app's directory.

$ cd /var/www/webauthn-practice
$ git clone https://github.com/snakaya/WebAuthn-practice.git .

2.Install required python modules.

$ pip install -r requirements.txt

3.Setup Database.

$ cd /var/www/webauthn-practice/app
$ python create_db.py

4.Start WebAuthn-practice

$ python app.py

You can access to http://localhost:5000/ .

Configuration

Please refer sample/.env.sample

Database Setting

Please set Database connection info via Environment Variables.

$ export WEBAUTHN_DB_TYPE=mysql
$ export WEBAUTHN_DB_USERID=scott
$ export WEBAUTHN_DB_PASSWORD=tiger
$ export WEBAUTHN_DB_HOST=127.0.0.1
$ export WEBAUTHN_DB_NAME=sampledb
  • WEBAUTHN_DB_TYPE
    • (Required) set your DB Type the followings:
      • SQLite: 'sqlite' (default)
      • MySQL: 'mysql'
      • PostgreSQL: 'postgresql'
      • Oracle: 'oracle'
  • WEBAUTHN_DB_USERID
    • set DB UserID.
  • WEBAUTHN_DB_PASSWORD
    • set DB UserID's Password.
  • WEBAUTHN_DB_HOST
    • set Database HostName or IP Address.
  • WEBAUTHN_DB_NAME
    • set Database Name (SID in Oracle, DB FileName in SQLite).

if you change DB Type, Please retry to create db.

RP ID and Origin

WebAuthn RP need to be set RP ID and Origin URL before of startup via Environment Variables.

$ export WEBAUTHN_RP_ID=www.example.com
$ export WEBAUTHN_ORIGIN=https://www.example.com
  • WEBAUTHN_RP_ID
  • WEBAUTHN_ORIGIN

Run using uWSGI

Yes, It is good idea. Please refer sample/uwsgi.ini.sample. Edit it and copy to your app directory.

$ uwsgi --ini uwsgi.ini

TODO

-[ ] Support Python3

-[ ] make docker-compose

License

BSD-3-Clause

Author

Seiji Nakaya / LOOSEDAYS (snakaya-(^^)-loosedays.jp)

About

A Testing Platform for WebAuthn Authenticator and Brawser.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 65.9%
  • HTML 33.8%
  • CSS 0.3%