webauthn

package
v1.0.0-dev.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package webauthn wraps go-webauthn/webauthn to provide WebAuthn/FIDO2 passkey ceremony helpers. It imports the core access package for types but never the reverse.

Index

Constants

View Source
const (
	// CeremonyTimeout is the maximum duration a user has to complete an auth ceremony.
	CeremonyTimeout = 5 * time.Minute
	// MaxResponseBytes is the largest authenticator response a Finish or
	// Complete call reads; a larger one is refused with [ErrResponseTooLarge].
	MaxResponseBytes = 64 << 10
)

Variables

View Source
var ErrCeremonyUnbound = errors.New("access/webauthn: the ceremony is not bound to an origin")

ErrCeremonyUnbound reports a ceremony carrying no origin, which a ceremony from a Begin function always does. It is a fail-closed guard against a Ceremony assembled some other way, never a condition a caller can reach.

View Source
var ErrIllegalRPID = errors.New("access/webauthn: illegal relying-party ID")

ErrIllegalRPID reports a value that cannot be a relying-party ID. Every error ValidateRPID returns matches it with errors.Is and also carries the upstream validator's reason.

View Source
var ErrNotDiscoverable = errors.New("access/webauthn: authenticator did not create a discoverable credential")

ErrNotDiscoverable reports a registration whose client stated the new credential is not client-side discoverable. Matchable with errors.Is so a caller can tell it apart from a verification failure and tell the user their authenticator cannot store a passkey.

View Source
var ErrResponseTooLarge = errors.New("access/webauthn: the authenticator response is larger than MaxResponseBytes")

ErrResponseTooLarge reports an authenticator response longer than MaxResponseBytes. At most MaxResponseBytes+1 bytes are read to decide it.

View Source
var ErrUnknownCredential = errors.New("access/webauthn: the asserted credential is not registered")

ErrUnknownCredential reports a login whose asserted credential this relying party has no record of, which is what a passkey deleted server-side looks like from the client's side. Matchable with errors.Is, so a caller can tell it apart from a verification failure and signal the client to forget the stale passkey rather than telling the user their sign-in failed. It wraps nothing: no go-webauthn error is reachable through it.

Functions

func AuthenticatorName

func AuthenticatorName(aaguid []byte) (string, bool)

AuthenticatorName returns the passkey provider name for a 16-byte AAGUID, from the community list at https://github.com/passkeydeveloper/passkey-authenticator-aaguids. It reports false for an unknown AAGUID or one that is not 16 bytes long. The AAGUID is self-asserted by the authenticator under "none" attestation, so the name is a display label, never evidence of the authenticator's make.

func BeginConditionalLogin

func BeginConditionalLogin(rp *RelyingParty, origin Origin) (*CredentialAssertion, Ceremony, error)

BeginConditionalLogin starts a WebAuthn assertion ceremony with conditional mediation, enabling browser autofill UI for passkeys, at origin, which must pass RelyingParty.CheckOrigin and is bound into the ceremony exactly as in BeginRegistration.

func BeginLogin

func BeginLogin(rp *RelyingParty, origin Origin) (*CredentialAssertion, Ceremony, error)

BeginLogin starts a WebAuthn assertion ceremony (discoverable login) at origin, which must pass RelyingParty.CheckOrigin and is bound into the ceremony exactly as in BeginRegistration.

func BeginReauthentication

func BeginReauthentication(rp *RelyingParty, user *User, origin Origin) (*CredentialAssertion, Ceremony, error)

BeginReauthentication starts an assertion bound to one user's credentials, for step-up, at origin, which must pass RelyingParty.CheckOrigin and is bound into the ceremony exactly as in BeginRegistration. A user with no passkey cannot begin one.

func BeginRegistration

func BeginRegistration(rp *RelyingParty, user *User, origin Origin) (*CredentialCreation, Ceremony, error)

BeginRegistration starts a WebAuthn registration ceremony at origin, the browser origin the request arrived from (see ParseOrigin). An origin that fails RelyingParty.CheckOrigin returns its *OriginError unchanged; the ceremony verifies the response against exactly that origin. The three ML-DSA parameter sets are offered ahead of EdDSA, ES256 and RS256, so a post-quantum authenticator registers a post-quantum credential and every other one still registers.

func FinishRegistration

func FinishRegistration(rp *RelyingParty, user *User, ceremony Ceremony, response io.Reader) (*access.PasskeyCredential, error)

FinishRegistration completes a registration from the PublicKeyCredential JSON in response, reading at most MaxResponseBytes (ErrResponseTooLarge past it), verified against the ceremony's bound origin (ErrCeremonyUnbound without one). A credential the client's credProps output reports as not discoverable is ErrNotDiscoverable, since no discoverable login can use it; a missing report is accepted, so forward clientExtensionResults for the check to fire.

func PasskeyFriendlyName

func PasskeyFriendlyName(aaguid []byte, existingNames []string) string

PasskeyFriendlyName returns a display-only label for a newly registered passkey that duplicates no entry in existingNames. A known AAGUID gets its registry name ("Chrome on Mac"), numbered from the second of its kind ("Chrome on Mac 2"); an unknown one is always numbered ("Passkey 1"). The number is one past the highest in use, so a gap left by a deletion never yields a duplicate.

func ValidateRPID

func ValidateRPID(id string) error

ValidateRPID reports whether id is a legal relying-party ID: a lowercase domain name with no scheme, port or path, not an IP address, and not a single label other than localhost. A refusal matches ErrIllegalRPID.

The lowercase requirement is this package's own: the upstream validator accepts "Example.COM", but the relying-party hash is computed over the configured bytes, so whether a mixed-case ID ever verifies depends on the client, and a configured value must not.

Types

type AttestationStatementFormat

type AttestationStatementFormat string

AttestationStatementFormat is an attestation statement format identifier the relying party will accept.

const (
	AttestationFormatPacked           AttestationStatementFormat = "packed"
	AttestationFormatTPM              AttestationStatementFormat = "tpm"
	AttestationFormatAndroidKey       AttestationStatementFormat = "android-key"
	AttestationFormatAndroidSafetyNet AttestationStatementFormat = "android-safetynet"
	AttestationFormatFIDOU2F          AttestationStatementFormat = "fido-u2f"
	AttestationFormatApple            AttestationStatementFormat = "apple"
	AttestationFormatCompound         AttestationStatementFormat = "compound"
	AttestationFormatNone             AttestationStatementFormat = "none"
)

The attestation statement formats registered by WebAuthn §8.

type AuthenticatorSelection

type AuthenticatorSelection struct {
	ResidentKey      ResidentKeyRequirement      `json:"residentKey,omitempty"`
	UserVerification UserVerificationRequirement `json:"userVerification,omitempty"`
}

AuthenticatorSelection is the relying party's criteria for which authenticators may be used (WebAuthn §5.4.4).

type AuthenticatorTransport

type AuthenticatorTransport string

AuthenticatorTransport is a transport an authenticator may be reached over. Clients must ignore a value they do not know, so this list is not exhaustive of what may arrive.

const (
	TransportUSB       AuthenticatorTransport = "usb"
	TransportNFC       AuthenticatorTransport = "nfc"
	TransportBLE       AuthenticatorTransport = "ble"
	TransportSmartCard AuthenticatorTransport = "smart-card"
	TransportHybrid    AuthenticatorTransport = "hybrid"
	TransportInternal  AuthenticatorTransport = "internal"
)

The transports defined by WebAuthn §5.8.4.

type Base64URL

type Base64URL []byte

Base64URL is a byte string that travels as unpadded base64url, the encoding every binary member of the options dictionaries uses.

func (Base64URL) MarshalJSON

func (b Base64URL) MarshalJSON() ([]byte, error)

MarshalJSON encodes the bytes as an unpadded base64url JSON string.

func (*Base64URL) UnmarshalJSON

func (b *Base64URL) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes an unpadded base64url JSON string. Padded input is accepted too, because some clients emit it.

type COSEAlgorithm

type COSEAlgorithm int

COSEAlgorithm is a COSE algorithm identifier, the value a relying party names to ask for a particular signature algorithm.

type Ceremony

type Ceremony struct {
	// contains filtered or unexported fields
}

Ceremony is the server-side state of one in-flight WebAuthn ceremony: the challenge and the parameters its Finish step verifies the response against. Keep it server-side, unmodified, from Begin to Finish, then discard it; a ceremony store needs only Ceremony.Expires. Copies share one immutable ceremony. The zero value is unusable and reports a zero deadline, so a lookup reports absence with a separate boolean.

func (Ceremony) Expires

func (c Ceremony) Expires() time.Time

Expires reports when the ceremony stops being verifiable. A ceremony store evicts on this rather than tracking its own creation time, so the deadline the authenticator was given and the deadline the store enforces cannot drift apart.

type ConveyancePreference

type ConveyancePreference string

ConveyancePreference is the relying party's attestation-conveyance preference. This library requests the specification's default, so it does not set the member.

const (
	ConveyanceNone       ConveyancePreference = "none"
	ConveyanceIndirect   ConveyancePreference = "indirect"
	ConveyanceDirect     ConveyancePreference = "direct"
	ConveyanceEnterprise ConveyancePreference = "enterprise"
)

The attestation-conveyance preferences defined by WebAuthn §5.4.7.

type CredentialAssertion

type CredentialAssertion struct {
	Mediation Mediation                `json:"mediation,omitempty"`
	Response  CredentialRequestOptions `json:"publicKey"`
}

CredentialAssertion is what a login ceremony hands the browser.

type CredentialCreation

type CredentialCreation struct {
	Response CredentialCreationOptions `json:"publicKey"`
}

CredentialCreation is what a registration ceremony hands the browser. The publicKey member is the name navigator.credentials.create() reads, so it is the specification yielding rather than this module's JSON convention breaking.

type CredentialCreationOptions

type CredentialCreationOptions struct {
	RelyingParty           RelyingPartyEntity           `json:"rp"`
	AuthenticatorSelection AuthenticatorSelection       `json:"authenticatorSelection"`
	Attestation            ConveyancePreference         `json:"attestation,omitempty"`
	User                   UserEntity                   `json:"user"`
	Challenge              Base64URL                    `json:"challenge"`
	Parameters             []CredentialParameter        `json:"pubKeyCredParams,omitempty"`
	ExcludeCredentials     []CredentialDescriptor       `json:"excludeCredentials,omitempty"`
	Hints                  []CredentialHint             `json:"hints,omitempty"`
	AttestationFormats     []AttestationStatementFormat `json:"attestationFormats,omitempty"`
	Timeout                int                          `json:"timeout,omitempty"`
	Extensions             RegistrationExtensions       `json:"extensions"`
}

CredentialCreationOptions is WebAuthn §5.4 PublicKeyCredentialCreationOptions: everything the client needs to create a credential.

type CredentialDescriptor

type CredentialDescriptor struct {
	Type       CredentialType           `json:"type"`
	ID         Base64URL                `json:"id"`
	Transports []AuthenticatorTransport `json:"transports,omitempty"`
}

CredentialDescriptor refers to an existing credential (WebAuthn §5.8.3). It carries only the three IDL members; upstream's equivalent also holds attestation bookkeeping that is never serialized.

type CredentialHint

type CredentialHint string

CredentialHint guides the client's user interface toward a kind of authenticator. It is a hint, so a client may ignore it.

const (
	HintSecurityKey  CredentialHint = "security-key"
	HintClientDevice CredentialHint = "client-device"
	HintHybrid       CredentialHint = "hybrid"
)

The hints defined by WebAuthn §5.8.7.

type CredentialParameter

type CredentialParameter struct {
	Type      CredentialType `json:"type"`
	Algorithm COSEAlgorithm  `json:"alg"`
}

CredentialParameter names a credential type and signature algorithm the relying party will accept (WebAuthn §5.3).

type CredentialRequestOptions

type CredentialRequestOptions struct {
	RelyingPartyID   string                      `json:"rpId,omitempty"`
	UserVerification UserVerificationRequirement `json:"userVerification,omitempty"`
	Challenge        Base64URL                   `json:"challenge"`
	AllowCredentials []CredentialDescriptor      `json:"allowCredentials,omitempty"`
	Hints            []CredentialHint            `json:"hints,omitempty"`
	Timeout          int                         `json:"timeout,omitempty"`
}

CredentialRequestOptions is WebAuthn §5.5 PublicKeyCredentialRequestOptions: everything the client needs to produce an assertion.

type CredentialType

type CredentialType string

CredentialType is the credential type of a public key credential. The specification defines exactly one value and marks the enumeration extensible.

const PublicKeyCredentialType CredentialType = "public-key"

PublicKeyCredentialType is the only credential type WebAuthn defines.

type LoginResult

type LoginResult struct {
	User         *access.User
	CredentialID []byte
	// CloneWarning reports that the sign counter regressed on this assertion,
	// the signal of a cloned authenticator; the stored flag stays set after it.
	CloneWarning bool
}

LoginResult is a verified assertion whose custody update is stored.

func CompleteLogin

func CompleteLogin(ctx context.Context, rp *RelyingParty, store Store, ceremony Ceremony, response io.Reader) (LoginResult, error)

CompleteLogin verifies a discoverable assertion read from response (at most MaxResponseBytes, else ErrResponseTooLarge) against the ceremony's bound origin (ErrCeremonyUnbound without one) and stores the custody update. The caller MUST check User.Enabled before creating a session. A handle with no account, or an account without the credential, is ErrUnknownCredential; a store failure, in the lookup or the custody write, matches access.ErrAuthBackend.

func CompleteReauthentication

func CompleteReauthentication(ctx context.Context, rp *RelyingParty, store Store, user *User, ceremony Ceremony, response io.Reader) (LoginResult, error)

CompleteReauthentication verifies a step-up assertion, read from response as in CompleteLogin, for user, the ceremony's user from BeginReauthentication with the passkeys stored now, and stores the custody update. A ceremony begun for another user, or a discoverable one, is refused; a credential user does not hold is ErrUnknownCredential; a failed custody write matches access.ErrAuthBackend.

type Mediation

type Mediation string

Mediation is the credential-mediation requirement, which decides how much the client may complete a ceremony without an explicit user gesture.

const (
	MediationSilent      Mediation = "silent"
	MediationOptional    Mediation = "optional"
	MediationConditional Mediation = "conditional"
	MediationRequired    Mediation = "required"
)

The mediation requirements defined by the Credential Management specification.

type Origin

type Origin struct {
	// contains filtered or unexported fields
}

Origin is a browser origin a ceremony may be conducted at: a scheme, a host and an optional port, with no path, query, fragment or userinfo. Construct one with ParseOrigin; the zero value is not a usable origin.

func ParseOrigin

func ParseOrigin(raw string) (Origin, error)

ParseOrigin parses a browser origin as a browser serializes it, typically an Origin request header; the error is a *OriginError. It applies only the normalizations the response comparison also applies (ASCII case folding, default-port elision) and refuses a trailing dot, an empty label, a non-ASCII host, one that is neither a hostname nor an IP address, and an IP address not spelled as a browser serializes it. A repair would turn a refusal before the authenticator prompt into a mismatch after it.

func (Origin) Host

func (o Origin) Host() string

Host returns the ASCII-lowercased host, without brackets or port.

func (Origin) IsZero

func (o Origin) IsZero() bool

IsZero reports whether o is the zero value rather than a parsed origin.

func (Origin) String

func (o Origin) String() string

String renders the origin in its canonical form, "scheme://host[:port]", with an IPv6 host bracketed. It is the value the ceremony's response is compared against.

type OriginError

type OriginError struct {
	// Origin is the refused value: as given for a parse failure, in canonical
	// form for a policy or list refusal.
	Origin string
	// RPID is the relying party that refused the origin; empty for a parse
	// failure, which involves no relying party.
	RPID   string
	Reason OriginRejection
}

OriginError reports a string that is not a usable origin, or an origin the relying party will not conduct a ceremony at. Matchable with errors.As as the pointer form. Error's message is diagnostic; a consumer composes its own user-facing sentence from Reason, because only the consumer knows what it calls the setting that holds the relying-party ID.

func (*OriginError) Error

func (e *OriginError) Error() string

type OriginRejection

type OriginRejection string

OriginRejection names why an origin cannot conduct a ceremony, or why a string is not a usable origin at all.

const (
	RejectMalformed   OriginRejection = "malformed"
	RejectTrailingDot OriginRejection = "trailing_dot"
	RejectEmptyLabel  OriginRejection = "empty_label"
	RejectNonASCII    OriginRejection = "non_ascii"
)

The parse-stage rejections, reported by ParseOrigin with an empty OriginError.RPID.

const (
	RejectNoOrigin       OriginRejection = "no_origin"
	RejectInsecureScheme OriginRejection = "insecure_scheme"
	RejectIPHost         OriginRejection = "ip_host"
	RejectHostNotCovered OriginRejection = "host_not_covered"
)

The policy-stage rejections, reported by RelyingParty.CheckOrigin.

const RejectNotAllowlisted OriginRejection = "not_allowlisted"

RejectNotAllowlisted is the list-stage rejection: the host rule accepted the origin, and it is not one of the accepted origins, the RPConfig.Origins entries or by default the relying party's exact origin.

func OriginRejections

func OriginRejections() []OriginRejection

OriginRejections returns every OriginRejection: the parse, policy and list stages in that order.

type OriginsError

type OriginsError struct {
	Err   *OriginError
	Entry string
	RPID  string
	Index int
}

OriginsError reports an RPConfig.Origins entry New refused: one that is not a usable origin, or one the origin policy for this relying party would itself reject. A list may only narrow what the policy admits, never widen it. It wraps the *OriginError naming the reason, so errors.As reaches both.

func (*OriginsError) Error

func (e *OriginsError) Error() string

func (*OriginsError) Unwrap

func (e *OriginsError) Unwrap() error

type RPConfig

type RPConfig struct {
	// ID is the relying party identifier, an effective domain
	// (e.g. "example.com"), spelled in lowercase. See [ValidateRPID].
	ID string
	// DisplayName is the human-readable relying party name shown by
	// authenticators.
	DisplayName string
	// Origins, when set, is the exact list of origins ceremonies may run at
	// (scheme, host and port), e.g. "https://app.example.com". Each must be
	// the ID or a subdomain of it: New refuses an entry the host rule rejects.
	Origins []string
	// AllowSubdomains widens the default (empty Origins) from the exact origin
	// to every subdomain and port of ID. It cannot be combined with Origins,
	// and is unsafe wherever another host under ID can run script.
	AllowSubdomains bool
}

RPConfig identifies the relying party that a New-constructed RelyingParty serves. The ID and display name would otherwise sit as adjacent same-typed string parameters, where a silent swap ships a broken RP ID; the field names make each value's role explicit at the call site.

The origin a ceremony expects is the origin it is begun at, judged by RelyingParty.CheckOrigin. By default only the relying party's exact origin is accepted; Origins replaces that set and AllowSubdomains widens it.

type RegistrationExtensions

type RegistrationExtensions struct {
	// CredProps requests the Credential Properties extension, whose output tells
	// the relying party whether the new credential is discoverable.
	CredProps bool `json:"credProps,omitempty"`
}

RegistrationExtensions are the client extension inputs a registration requests. It carries only credProps, because that is the only extension this library requests; an extension that is not requested is never reported, so a member for one would always be false.

type RelyingParty

type RelyingParty struct {
	// contains filtered or unexported fields
}

RelyingParty is a configured relying party, and the value every ceremony function takes. It replaces the upstream handle on this package's exported surface so a consumer needs no go-webauthn import to run a ceremony.

Construct one with New. The zero value is not usable.

func New

func New(rp RPConfig) (*RelyingParty, error)

New creates a configured RelyingParty. An RPConfig with an empty ID is rejected here with an error naming the field, an illegal ID with one matching ErrIllegalRPID, and Origins set beside AllowSubdomains with an error naming both, so a misconfigured relying party surfaces at construction rather than as a failed ceremony. An Origins entry that is not a usable origin, or that the host rule would refuse, is rejected with a *OriginsError naming the entry.

func (*RelyingParty) CheckOrigin

func (rp *RelyingParty) CheckOrigin(o Origin) error

CheckOrigin returns nil when a ceremony may run at o, else a *OriginError. The host rule comes first: https, or http on localhost, at the relying-party ID or a subdomain of it, on any port. Unless RPConfig.AllowSubdomains is set, o must then equal on scheme, host and port an RPConfig.Origins entry, or by default https://<ID> on the default port (plus http://localhost for the ID localhost); a miss is RejectNotAllowlisted.

func (*RelyingParty) ID

func (rp *RelyingParty) ID() string

ID returns the relying party identifier ceremonies are bound to. A stored credential records the ID it was registered against, so comparing the two is how a relying-party rename is detected rather than silently orphaning every passkey.

type RelyingPartyEntity

type RelyingPartyEntity struct {
	// Name is the human-palatable relying party name, for display only.
	Name string `json:"name"`
	// ID is the relying party identifier, which sets the RP ID.
	ID string `json:"id"`
}

RelyingPartyEntity describes the relying party a credential is registered to (WebAuthn §5.4.2).

type ResidentKeyRequirement

type ResidentKeyRequirement string

ResidentKeyRequirement is the relying party's requirement for a client-side discoverable credential.

const (
	ResidentKeyDiscouraged ResidentKeyRequirement = "discouraged"
	ResidentKeyPreferred   ResidentKeyRequirement = "preferred"
	ResidentKeyRequired    ResidentKeyRequirement = "required"
)

The resident-key requirements defined by WebAuthn §5.4.6.

type SignalAllAcceptedCredentials

type SignalAllAcceptedCredentials struct {
	RPID                     string      `json:"rpId"`
	UserID                   Base64URL   `json:"userId"`
	AllAcceptedCredentialIDs []Base64URL `json:"allAcceptedCredentialIds"`
}

SignalAllAcceptedCredentials is the payload for the client's signalAllAcceptedCredentials call: every credential this relying party still accepts for the user.

An EMPTY list is meaningful and is not the same as sending nothing — it tells the credential manager to remove every passkey it holds for this account, which is the correct signal after the last one is deleted server-side. It therefore always serializes as a JSON array, never as null.

type SignalCurrentUserDetails

type SignalCurrentUserDetails struct {
	RPID        string    `json:"rpId"`
	Name        string    `json:"name"`
	DisplayName string    `json:"displayName"`
	UserID      Base64URL `json:"userId"`
}

SignalCurrentUserDetails is the payload for the client's signalCurrentUserDetails call: what the account is called now.

type Signals

type Signals struct {
	CurrentUserDetails     SignalCurrentUserDetails     `json:"currentUserDetails"`
	AllAcceptedCredentials SignalAllAcceptedCredentials `json:"allAcceptedCredentials"`
}

Signals carries both reconciliation payloads for one user, derived together because both are read from the same account state and a client that sends one wants the other.

func NewSignals

func NewSignals(rpID string, user *User) Signals

NewSignals derives both reconciliation payloads from a user and their stored credentials. It is pure and cannot fail: every value is read from the user, so there is no lookup to go wrong.

The display name falls back to the username when the account has none, which matches what registration put in the credential in the first place, so the signal does not blank a name the authenticator is already showing.

type Store

type Store interface {
	PasskeysByUserID(ctx context.Context, userID int64) ([]access.PasskeyCredential, error)
	UpdatePasskeyAfterLogin(ctx context.Context, userID int64, credID []byte, upd access.PasskeyLoginUpdate) error
	UserByWebAuthnHandle(ctx context.Context, handle []byte) (user *access.User, found bool, err error)
}

Store is the store interface CompleteLogin and CompleteReauthentication consume: the account and its passkeys by user handle, and the post-login custody write. An github.com/cplieger/access/account.Store satisfies it.

type User

type User struct {
	AuthUser    *access.User
	Credentials []access.PasskeyCredential
}

User adapts access.User + credentials to the gowebauthn.User interface.

func NewUser

func NewUser(user *access.User, creds []access.PasskeyCredential) (*User, error)

NewUser returns a User with the given user and credentials.

func (*User) WebAuthnDisplayName

func (u *User) WebAuthnDisplayName() string

WebAuthnDisplayName returns the display name, falling back to username.

func (*User) WebAuthnID

func (u *User) WebAuthnID() []byte

WebAuthnID returns the account's stored WebAuthn user handle.

The store sets it with access.GenerateWebAuthnHandle at account creation and never changes it; every passkey is bound to the value in force at its registration. An empty handle violates the specification's MUST NOT-be-empty rule, so a store that returns one is misconfigured.

func (*User) WebAuthnName

func (u *User) WebAuthnName() string

WebAuthnName returns the username.

type UserEntity

type UserEntity struct {
	// Name is a human-palatable account identifier, for display only.
	Name string `json:"name"`
	// DisplayName is a human-palatable name for the account holder, for display
	// only.
	DisplayName string `json:"displayName"`
	// ID is the user handle. Authentication and authorization decisions are made
	// on this value, never on the two names above.
	ID Base64URL `json:"id"`
}

UserEntity describes the user account a credential is registered to (WebAuthn §5.4.3).

type UserVerificationRequirement

type UserVerificationRequirement string

UserVerificationRequirement is the relying party's user-verification requirement for a ceremony.

const (
	VerificationRequired    UserVerificationRequirement = "required"
	VerificationPreferred   UserVerificationRequirement = "preferred"
	VerificationDiscouraged UserVerificationRequirement = "discouraged"
)

The user-verification requirements defined by WebAuthn §5.8.6.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL