egregors / go-passkey

Proof-of-concept material for "Passkey in Go" blog post.
MIT License
27 stars 0 forks source link

Program does not work with safari #1

Open laplantePierre opened 2 months ago

laplantePierre commented 2 months ago

Panic at line can't get session id:

2024/08/19 17:57:05 [INFO] make webauthn config 2024/08/19 17:57:05 [INFO] create webauthn 2024/08/19 17:57:05 [INFO] create datastore 2024/08/19 17:57:05 [INFO] register routes 2024/08/19 17:57:05 [INFO] start server at http://localhost:8080 2024/08/19 17:57:30 [INFO] begin registration ----------------------\ 2024/08/19 17:57:30 [DEBUG] GetOrCreateUser: Peter 2024/08/19 17:57:30 [DEBUG] GetOrCreateUser: creating new user: Peter 2024/08/19 17:57:30 [DEBUG] SaveSession: V7N4aEBWE8EiAvARK8UGqtNKIZfpQLUuuaFOTdOclzk= - {CHU4oSsBGyLMvCbv766npIoGPZ5_xaRsIFNsK5dQssw localhost [80 101 116 101 114] [] 0001-01-01 00:00:00 +0000 UTC map[]} 2024/08/19 17:57:37 [ERRO] can't get session id: http: named cookie not present 2024/08/19 17:57:37 http: panic serving [::1]:52022: http: named cookie not present goroutine 19 [running]: net/http.(conn).serve.func1() /usr/local/go/src/net/http/server.go:1898 +0xb0 panic({0x1006825e0?, 0x1008a5550?}) /usr/local/go/src/runtime/panic.go:770 +0x124 main.FinishRegistration({0x1006e1eb8, 0x1400020a1c0}, 0x14000000b40) /Users/laplante/go/src/webauthntest/main.go:138 +0x4a4 net/http.HandlerFunc.ServeHTTP(0x1008b2cc0?, {0x1006e1eb8?, 0x1400020a1c0?}, 0x14000027b00?) /usr/local/go/src/net/http/server.go:2166 +0x38 net/http.(ServeMux).ServeHTTP(0x10?, {0x1006e1eb8, 0x1400020a1c0}, 0x14000000b40) /usr/local/go/src/net/http/server.go:2683 +0x1a4 net/http.serverHandler.ServeHTTP({0x1006e10e8?}, {0x1006e1eb8?, 0x1400020a1c0?}, 0x6?) /usr/local/go/src/net/http/server.go:3137 +0xbc net/http.(conn).serve(0x140000f4090, {0x1006e2600, 0x1400009ef00}) /usr/local/go/src/net/http/server.go:2039 +0x508 created by net/http.(Server).Serve in goroutine 1 /usr/local/go/src/net/http/server.go:3285 +0x3f0

egregors commented 2 months ago

@laplantePierre this is a proof-of-concept example. To get more ready to real world example, please check https://github.com/egregors/passkey