== WebAuthn Server Example This example shows a minimal website that uses python-fido2 to implement WebAuthn credential registration, and use. === Running To run this sample, you will need `uv`. For instructions on installing `uv`, see https://docs.astral.sh/uv/. Run the following command in the `examples/server` directory to set up the example: $ uv sync Once the environment has been created, you can run the server by running: $ uv run server When the server is running, use a browser supporting WebAuthn and open http://localhost:5000 to access the website. NOTE: Webauthn requires a secure context (HTTPS), which involves obtaining a valid TLS certificate. However, most browsers also treat http://localhost as a secure context. This example runs without TLS as a demo, but otherwise you should always use HTTPS with a valid certificate when using Webauthn. === Using the website The site allows you to register a WebAuthn credential, and to authenticate it. Credentials are only stored in memory, and stopping the server will cause it to "forget" any registered credentials. ==== Registration 1. Click on the `Register` link to begin credential registration. 2. If not already inserted, insert your U2F/FIDO2 Authenticator now. 3. Touch the button to activate the Authenticator. 4. A popup will indicate whether the registration was successful. Click `OK`. ==== Authentication NOTE: You must register a credential prior to authentication. 1. Click on the `Authenticate` link to begin authentication. 2. If not already inserted, insert your U2F/FIDO2 Authenticator now. 3. Touch the button to activate the Authenticator. 4. A popup will indicate whether the authentication was successful. Click `OK`.