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 ¶
- Variables
- func IsAvailable() bool
- func Login(_ context.Context, origin string, assertion *wantypes.CredentialAssertion, ...) (*proto.MFAAuthenticateResponse, string, error)
- func Register(_ context.Context, origin string, cc *wantypes.CredentialCreation) (*proto.MFARegisterResponse, error)
- func ResetPromptPlatformMessage()
- type AuthenticatorAttachment
- type CheckSupportResult
- type DiagResult
- type GUID
- type LoginOpts
Constants ¶
This section is empty.
Variables ¶
var ( // PromptPlatformMessage is the message shown before system prompts. PromptPlatformMessage = defaultPromptMessage // 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(_ context.Context, origin string, assertion *wantypes.CredentialAssertion, loginOpts *LoginOpts) (*proto.MFAAuthenticateResponse, string, error)
Login implements Login for Windows Webauthn API.
func Register ¶
func Register(_ context.Context, origin string, cc *wantypes.CredentialCreation) (*proto.MFARegisterResponse, error)
Register implements Register for Windows Webauthn API.
func ResetPromptPlatformMessage ¶
func ResetPromptPlatformMessage()
ResetPromptPlatformMessage resets PromptPlatformMessage to its original state.
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 LoginOpts ¶
type LoginOpts struct { // AuthenticatorAttachment specifies the desired authenticator attachment. AuthenticatorAttachment AuthenticatorAttachment }
LoginOpts groups non-mandatory options for Login.