Documentation ¶
Overview ¶
Package webauthn handles WebAuthn related functionalities.
Index ¶
- type Service
- func (s *Service) BeginAddDevice() http.HandlerFunc
- func (s *Service) BeginLogin() http.HandlerFunc
- func (s *Service) BeginRegistration() http.HandlerFunc
- func (s *Service) DeleteDevice() http.HandlerFunc
- func (s *Service) FinishAddDevice() http.HandlerFunc
- func (s *Service) FinishLogin() http.HandlerFunc
- func (s *Service) FinishRegistration() http.HandlerFunc
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.