Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Available ¶ added in v0.1.0
func Available() bool
Available reports whether the browser exposes the WebAuthn API at all.
func PlatformAuthenticatorAvailable ¶ added in v0.1.0
func PlatformAuthenticatorAvailable() bool
PlatformAuthenticatorAvailable blocks until the browser answers whether a built-in authenticator (Touch ID, Windows Hello, Android biometrics) exists.
Types ¶
type Assertion ¶ added in v0.1.0
type Assertion struct {
CredentialID []byte
RawResponse string // base64url JSON, ready to POST to a verifier
PRFOutput []byte // 32 bytes, or nil when prf was not requested or not supported
}
Assertion is the result of an assertion ceremony.
func Get ¶ added in v0.1.0
func Get(opts GetOptions) (*Assertion, error)
Get runs navigator.credentials.get. Same goroutine and gesture requirements as Create.
type CreateOptions ¶ added in v0.1.0
type CreateOptions struct {
RPID string // relying party id — the origin's domain, e.g. "app.example.com"
RPName string
UserID []byte // opaque, stable, never the email
UserName string // shown in the account picker
UserDisplayName string
Challenge []byte // 32 random bytes; server-issued for auth, local for encryption
ResidentKey bool // true for a discoverable passkey
UserVerification string // "required" | "preferred" | "discouraged"
EnablePRF bool // request the prf extension
}
CreateOptions describes a registration ceremony.
type Credential ¶ added in v0.1.0
type Credential struct {
ID []byte
RawResponse string // base64url JSON, ready to POST to a verifier
PRFEnabled bool // the authenticator will honour prf on later assertions
}
Credential is the result of a registration ceremony.
func Create ¶ added in v0.1.0
func Create(opts CreateOptions) (*Credential, error)
Create runs navigator.credentials.create. It blocks the calling goroutine until the user completes or cancels the ceremony, and MUST be called from a goroutine started by a user-gesture event handler.