webauthnwin

package
v11.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package webauthnwin is wrapper around Windows webauthn API. It loads system webauthn.dll and uses its methods. It supports API versions 1+. API definition: https://github.com/microsoft/webauthn/blob/master/webauthn.h As Windows Webauthn device can be used both Windows Hello and FIDO devices.

Index

Constants

This section is empty.

Variables

View Source
var (
	// PromptPlatformMessage is the message shown before Touch ID prompts.
	PromptPlatformMessage = "Using platform authenticator, follow the OS dialogs"
	// PromptWriter is the writer used for prompt messages.
	PromptWriter io.Writer = os.Stderr
)

Functions

func IsAvailable

func IsAvailable() bool

IsAvailable returns true if Windows webauthn library is available in the system. Typically, a series of checks is performed in an attempt to avoid false positives. See CheckSupport.

func Login

func Login(ctx context.Context, origin string, assertion *wanlib.CredentialAssertion, loginOpts *LoginOpts) (*proto.MFAAuthenticateResponse, string, error)

Login implements Login for Windows Webauthn API.

func Register

Register implements Register for Windows Webauthn API.

Types

type AuthenticatorAttachment

type AuthenticatorAttachment int
const (
	AttachmentAuto AuthenticatorAttachment = iota
	AttachmentCrossPlatform
	AttachmentPlatform
)

type CheckSupportResult

type CheckSupportResult struct {
	HasCompileSupport  bool
	IsAvailable        bool
	HasPlatformUV      bool
	WebAuthnAPIVersion int
}

CheckSupport is the result from a Windows webauthn support check.

func CheckSupport

func CheckSupport() CheckSupportResult

CheckSupport return information whether Windows Webauthn is supported and information about API version.

type DiagResult

type DiagResult struct {
	Available                           bool
	RegisterSuccessful, LoginSuccessful bool
}

func Diag

func Diag(ctx context.Context, promptOut io.Writer) (*DiagResult, error)

Diag runs a few diagnostic commands and returns the result. User interaction is required.

type GUID

type GUID struct {
	Data1 uint32
	Data2 uint16
	Data3 uint16
	Data4 [8]byte
}

type LoginOpts

type LoginOpts struct {
	// AuthenticatorAttachment specifies the desired authenticator attachment.
	AuthenticatorAttachment AuthenticatorAttachment
}

LoginOpts groups non-mandatory options for Login.

Jump to

Keyboard shortcuts

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