Documentation
¶
Overview ¶
Package passkeys is the official WebAuthn passkey plugin of Auth-All.
A signed-in user registers passkeys, lists them, and deletes them. Anyone signs in with a passkey through a discoverable ceremony, so the browser offers the passkeys it holds and no address is named. The plugin verifies every response with github.com/go-webauthn/webauthn.
A sign-in with the user-verified flag issues the session at once, because the device proved two factors. A sign-in without the flag runs the TOTP challenge of a user with a confirmed second factor, as every other first factor does.
The plugin owns two tables. Migrate creates them.
Index ¶
Constants ¶
const ( // VerificationRequired refuses an authenticator that cannot check a PIN // or a biometric. VerificationRequired = "required" // VerificationPreferred asks for a check and accepts an authenticator // without one. It is the default. VerificationPreferred = "preferred" // VerificationDiscouraged asks the authenticator to skip the check. VerificationDiscouraged = "discouraged" )
User verification requirements.
const DefaultFreshAge = 10 * time.Minute
DefaultFreshAge is the default maximum age of a session that registers or deletes a passkey.
const ID = "passkey"
ID is the plugin identifier. It is also the session method of a passkey sign-in.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Plugin)
Option configures the plugin.
func FreshAge ¶
FreshAge sets the maximum age of a session that registers or deletes a passkey. An older session gets 403 SESSION_NOT_FRESH. The default is DefaultFreshAge.
func Origins ¶
Origins sets the origins that a response may come from, for example "https://app.example.com". The default is the origin of the base URL.
func RPDisplayName ¶
RPDisplayName sets the name that the browser shows during a ceremony. The default is the RP ID.
func RPID ¶
RPID sets the relying party ID, which is the registrable domain that every passkey binds to, for example "example.com". The default is the host of the base URL. A passkey of one RP ID never works under another, so the value must stay the same for the life of the application.
func UserVerification ¶
UserVerification sets the user verification requirement of both ceremonies: VerificationRequired, VerificationPreferred, or VerificationDiscouraged. The default is VerificationPreferred.
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin is the passkeys plugin.
func (*Plugin) Cleanup ¶
Cleanup removes the ceremonies that expired more than one hour ago. The host calls it on its own schedule, because Auth-All runs no background work.
func (*Plugin) Delete ¶
Delete removes one passkey of one user. It returns NOT_FOUND when the user holds no passkey with that identifier.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package passkeystest provides a virtual WebAuthn authenticator for Go tests.
|
Package passkeystest provides a virtual WebAuthn authenticator for Go tests. |