webauthn

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package webauthn handles WebAuthn related functionalities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service prepares WebAuthn handlers.

func New

func New(
	webAuthn *webauthn.WebAuthn,
	users user.Repository,
	store session.Store,
	jwtSecret jwt.Secret,
) *Service

New instanciates a Webauthn Service.

func (*Service) BeginAddDevice

func (s *Service) BeginAddDevice() http.HandlerFunc

BeginAddDevice beings the webauthn registration flow.

Based on the user identity, webauthn will generate options for the authenticator. We send the options over JSON (not very htmx).

Compared to BeginRegistration, BeginAddDevice uses the JWT to allow the registration.

func (*Service) BeginLogin

func (s *Service) BeginLogin() http.HandlerFunc

BeginLogin is the handler called to generate options for the user's authenticator.

func (*Service) BeginRegistration

func (s *Service) BeginRegistration() http.HandlerFunc

BeginRegistration beings the webauthn flow.

Based on the user identity, webauthn will generate options for the authenticator. We send the options over JSON (not very htmx).

func (*Service) DeleteDevice

func (s *Service) DeleteDevice() http.HandlerFunc

DeleteDevice deletes a webauthn credential.

func (*Service) FinishAddDevice

func (s *Service) FinishAddDevice() http.HandlerFunc

FinishAddDevice finishes the webauthn registration flow.

The user has created options based on the options. We fetch the registration session from the session store. We complete the registration.

func (*Service) FinishLogin

func (s *Service) FinishLogin() http.HandlerFunc

FinishLogin is the handler called after the user's authenticator sent its payload.

func (*Service) FinishRegistration

func (s *Service) FinishRegistration() http.HandlerFunc

FinishRegistration finishes the webauthn flow.

The user has created options based on the options. We fetch the registration session from the session store. We complete the registration.

Directories

Path Synopsis
Package session handles the login/register sessions of webauthn.
Package session handles the login/register sessions of webauthn.

Jump to

Keyboard shortcuts

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