{"id":18131630,"url":"https://github.com/mrtc0/go-webauthn","last_synced_at":"2025-07-20T09:10:47.629Z","repository":{"id":260119299,"uuid":"858200259","full_name":"mrtc0/go-webauthn","owner":"mrtc0","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-01T12:03:35.000Z","size":220,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-14T15:54:55.794Z","etag":null,"topics":["golang","passkeys","webauthn"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrtc0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-16T13:40:16.000Z","updated_at":"2024-12-04T06:40:24.000Z","dependencies_parsed_at":"2024-11-13T16:22:52.134Z","dependency_job_id":"5ed99154-3641-44a9-ba99-1f2f7c7da5d7","html_url":"https://github.com/mrtc0/go-webauthn","commit_stats":null,"previous_names":["mrtc0/go-webauthn"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mrtc0/go-webauthn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrtc0%2Fgo-webauthn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrtc0%2Fgo-webauthn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrtc0%2Fgo-webauthn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrtc0%2Fgo-webauthn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrtc0","download_url":"https://codeload.github.com/mrtc0/go-webauthn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrtc0%2Fgo-webauthn/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266094047,"owners_count":23875562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","passkeys","webauthn"],"created_at":"2024-11-01T12:08:21.997Z","updated_at":"2025-07-20T09:10:47.604Z","avatar_url":"https://github.com/mrtc0.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-webauthn\n\nThis library helps implement [WebAuthn](\u003c(https://www.w3.org/TR/webauthn-3)\u003e) Relying Party functionality in Go.\n\n\u003e [!WARNING]\n\u003e While it does not fully comply with the WebAuthn Level 3 specification at present, it can implement authentication using Passkeys.\n\n# Examples\n\nSee the [example](./example) directory for examples on how to use this library.\n\n### Credential Registration\n\n**Initiation phase**\n\n```go\nvar (\n    rpConfig = \u0026webauthn.RPConfig{\n    \t\tID:      \"localhost\",\n    \t\tName:    \"localhost\",\n    \t\tOrigins: []string{\"http://localhost:8080\"},\n    \t}\n)\n\n// Save the session and return the options as a response\noptions, webauthnSession, err := webauthn.CreateRegistrationCeremonyOptions(rpConfig, *webauthnUser)\n```\n\n**Verification phase**\n\n```go\nvar registrationResponse webauthn.RegistrationResponseJSON\nif err := json.NewDecoder(r.Body).Decode(\u0026registrationResponse); err != nil {\n    http.Error(w, err.Error(), http.StatusBadRequest)\n\treturn\n}\n\n// Save the credential associated with the user.\n// See WebAuthn Level 3 for data that RP should save: https://www.w3.org/TR/webauthn-3/#reg-ceremony-store-credential-record\n// Also, it should be verified that credential.ID is not associated with other users.\ncredential, err := webauthn.VerifyRegistrationCelemonyResponse(rpConfig, *session, registrationResponse, nil)\n```\n\n### Authentication\n\n**Initiation phase**\n\n```go\n// Save the session and return the options as a response\noptions, session, err := webauthn.CreateAuthenticationOptions(rpConfig, sessionID)\n```\n\n**Verification phase**\n\n```go\nvar authenticationResponse webauthn.AuthenticationResponseJSON\nif err := json.NewDecoder(r.Body).Decode(\u0026authenticationResponse); err != nil {\n\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\treturn\n}\n\nparam := webauthn.VerifyDiscoverableCredentialAuthenticationParam{\n\tRPConfig:           rpConfig,\n\tChallenge:          session.Challenge,\n\tAllowedCredentials: session.AllowedCredentials,\n\tUserVerification:   session.UserVerification,\n}\n\nwebauthnUser, credentialRecord, err := webauthn.VerifyDiscoverableCredentialAuthenticationResponse(\n\tparam,\n\tdiscoverUserPasskey,\n\tauthenticationResponse,\n\tnil,\n)\n\nuser := ToYourUserModel(webauthnUser)\nuser.UpdatePasskey(credentialRecord)\n\n// en: discoverUserPasskey is a function that RP should implement to get the passkey associated with the user from your database using credentialRawID and userHandle as keys.\nfunc discoverUserPasskey(credentialRawID []byte, userHandle string) (*webauthn.WebAuthnUser, *webauthn.CredentialRecord, error) {}\n```\n\n## Modify registration and authentication options\n\nYou can modify registration and authentication options using `webauthn.WithUserVerification` and `webauthn.WithAttestaion`.\n\n```go\nwebauthn.CreateRegistrationCeremonyOptions(\n    rpConfig,\n    *webauthnUser,\n    webauthn.WithAttestationPreference(webauthn.AttestationConveyancePreferenceIndirect)\n)\n```\n\n# Status\n\nThis library's releases are not stable. Therefore, breaking changes may be made without warning.\n\n## Support Attestation Statement Format\n\n| Attestation Statement Format | Supported |\n| ---------------------------- | --------- |\n| none                         | Yes       |\n| packed                       | Yes       |\n| apple                        | No        |\n| android-key                  | No        |\n| android-safetynet            | No        |\n| tpm                          | No        |\n| fido-u2f                     | No        |\n\n## Client Extensions\n\nClient Extensions are not yet supported.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrtc0%2Fgo-webauthn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrtc0%2Fgo-webauthn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrtc0%2Fgo-webauthn/lists"}