webauthn

package
v0.25.2 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package webauthn contains handlers for the WebAuthn flow in authenticate.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler is the WebAuthn device handler.

func New

func New(getState StateProvider) *Handler

New creates a new Handler.

func (*Handler) GetOptions

func (h *Handler) GetOptions(r *http.Request) (
	creationOptions *webauthn.PublicKeyCredentialCreationOptions,
	requestOptions *webauthn.PublicKeyCredentialRequestOptions,
	err error,
)

GetOptions returns the creation and request options for WebAuthn.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves the HTTP handler.

type State

type State struct {
	AuthenticateURL         *url.URL
	InternalAuthenticateURL *url.URL
	Client                  databroker.DataBrokerServiceClient
	RelyingParty            *webauthn.RelyingParty
	Session                 *session.Session
	SessionState            *sessions.State
	SessionStore            sessions.SessionStore
	SharedKey               []byte
	BrandingOptions         httputil.BrandingOptions
}

State is the state needed by the Handler to handle requests.

type StateProvider

type StateProvider = func(*http.Request) (*State, error)

A StateProvider provides state for the handler.

Jump to

Keyboard shortcuts

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