Skip to content

Commit

Permalink
Merge pull request #167 from teamhanko/remove-transports
Browse files Browse the repository at this point in the history
fix: remove transports at webauthn login
  • Loading branch information
FreddyDevelop authored Aug 4, 2022
2 parents 9f415cc + 77cfcc7 commit d4dc551
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backend/handler/webauthn.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ func (h *WebauthnHandler) BeginAuthentication(c echo.Context) error {
return fmt.Errorf("failed to store webauthn assertion session data: %w", err)
}

// Remove all transports, because of a bug in android and windows where the internal authenticator gets triggered,
// when the transports array contains the type 'internal' although the credential is not available on the device.
for i, _ := range options.Response.AllowedCredentials {
options.Response.AllowedCredentials[i].Transport = nil
}

return c.JSON(http.StatusOK, options)
}

Expand All @@ -215,7 +221,6 @@ func (h *WebauthnHandler) FinishAuthentication(c echo.Context) error {
return dto.NewHTTPError(http.StatusBadRequest, err.Error())
}


return h.persister.Transaction(func(tx *pop.Connection) error {
sessionDataPersister := h.persister.GetWebauthnSessionDataPersisterWithConnection(tx)
sessionData, err := sessionDataPersister.GetByChallenge(request.Response.CollectedClientData.Challenge)
Expand Down

0 comments on commit d4dc551

Please sign in to comment.