Convert PublicKeyCredentialRequestOptions.timeout to milliseconds (#26) Convert PublicKeyCredentialRequestOptions.timeout to milliseconds. Add reference to w3.org specification
Convert PublicKeyCredentialRequestOptions.timeout to milliseconds (#26)
Convert PublicKeyCredentialRequestOptions.timeout to milliseconds.
Add reference to w3.org specification
This package provides a Swift implementation of the WebAuthn API focused on making it easy to leverage the power of WebAuthn.
🚨 This library is a proof of concept - do not use it in production yet!
Adding the dependency
Add the following entry in your Package.swift to start using WebAuthn:
Package.swift
WebAuthn
.package(url: "https://github.com/swift-server/webauthn-swift.git", branch: "main")
and WebAuthn dependency to your target:
.target(name: "MyApp", dependencies: [.product(name: "WebAuthn", package: "webauthn-swift")])
Configure your Relying Party with a WebAuthnManager instance:
WebAuthnManager
let webAuthnManager = WebAuthnManager( config: WebAuthnConfig( relyingPartyDisplayName: "My Fancy Web App", relyingPartyID: "example.com", relyingPartyOrigin: "https://example.com", timeout: 600 ) )
For a registration ceremony use the following two methods:
WebAuthnManager.beginRegistration()
WebAuthnManager.finishRegistration()
For an authentication ceremony use the following two methods:
WebAuthnManager.beginAuthentication()
WebAuthnManager.finishAuthentication()
Swift WebAuthn is heavily inspired by existing WebAuthn libraries like py_webauthn and go-webauthn.
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
webauthn-swift
This package provides a Swift implementation of the WebAuthn API focused on making it easy to leverage the power of WebAuthn.
🚨 This library is a proof of concept - do not use it in production yet!
Getting Started
Adding the dependency
Add the following entry in your
Package.swift
to start usingWebAuthn
:and
WebAuthn
dependency to your target:Setup
Configure your Relying Party with a
WebAuthnManager
instance:Registration
For a registration ceremony use the following two methods:
WebAuthnManager.beginRegistration()
WebAuthnManager.finishRegistration()
Authentication
For an authentication ceremony use the following two methods:
WebAuthnManager.beginAuthentication()
WebAuthnManager.finishAuthentication()
Credits
Swift WebAuthn is heavily inspired by existing WebAuthn libraries like py_webauthn and go-webauthn.
Links