{"id":13703021,"url":"https://github.com/nov/web_authn","last_synced_at":"2025-08-19T22:32:04.279Z","repository":{"id":56897917,"uuid":"146547567","full_name":"nov/web_authn","owner":"nov","description":"W3C Web Authentication API (a.k.a. WebAuthN / FIDO 2.0) RP library in Ruby","archived":false,"fork":false,"pushed_at":"2024-06-13T14:09:26.000Z","size":74,"stargazers_count":20,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-12-09T16:26:54.420Z","etag":null,"topics":["fido","fido2","web-authentication","webauth","webauthn"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/nov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","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},"funding":{"github":"nov"}},"created_at":"2018-08-29T05:01:57.000Z","updated_at":"2024-09-07T13:57:57.000Z","dependencies_parsed_at":"2024-01-25T04:47:34.595Z","dependency_job_id":"c9246b4f-0cc3-4bb3-a9f9-8603a1ba4c8c","html_url":"https://github.com/nov/web_authn","commit_stats":{"total_commits":80,"total_committers":2,"mean_commits":40.0,"dds":0.03749999999999998,"last_synced_commit":"dee26a064c8b0efba82e82046962fc7f4503c882"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nov%2Fweb_authn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nov%2Fweb_authn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nov%2Fweb_authn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nov%2Fweb_authn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nov","download_url":"https://codeload.github.com/nov/web_authn/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230374118,"owners_count":18216041,"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":["fido","fido2","web-authentication","webauth","webauthn"],"created_at":"2024-08-02T21:00:49.013Z","updated_at":"2024-12-19T04:06:31.354Z","avatar_url":"https://github.com/nov.png","language":"Ruby","funding_links":["https://github.com/sponsors/nov"],"categories":["Server Libraries","Ruby"],"sub_categories":[],"readme":"# WebAuthn\n\nW3C Web Authentication API (a.k.a. WebAuthN / FIDO 2.0) RP library in Ruby\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'web_authn'\n```\n\nAnd then execute:\n\n```sh\n$ bundle\n```\n\nOr install it yourself as:\n\n```sh\n$ gem install web_authn\n```\n\n## Usage\n\n```ruby\ncontext = WebAuthn.context_for(\n  client_data_json, # NOTE: URL-safe Base64 encoded\n  origin: request.base_url,\n  challenge: session[:challenge],\n)\n\nif context.registration?\n  context.verify!(\n    attestation_object # URL-safe Base64 encoded\n  )\n  context.credential_id\n  context.public_key # =\u003e `OpenSSL::PKey::RSA` or `OpenSSL::PKey::EC`\n  context.public_cose_key # =\u003e `COSE::Key::RSA` or `COSE::Key::EC2` ref.) https://github.com/nov/cose-key\n  context.sign_count # =\u003e `Integer`\nelsif context.authentication?\n  context.verify!(\n    authenticator_data, # URL-safe Base64 encoded\n\n    # NOTE:\n    #  either 'public_key' or 'public_cose_key' is required.\n    #  if `public_key` is given, you can also specify `digest` (default: `OpenSSL::Digest::SHA256.new`).\n    #  if `public_cose_key` is given, it includes digest size information, so no `digest` is required.\n\n    # public_key: public_key, # `OpenSSL::PKey::RSA` or `OpenSSL::PKey::EC`\n    # digest: OpenSSL::Digest::SHA256.new, # `OpenSSL::Digest::SHA(1|256|384|512)`` (default: `OpenSSL::Digest::SHA256`)\n    public_cose_key: public_cose_key, # `COSE::Key::RSA` or `COSE::Key::EC` ref.) https://github.com/nov/cose-key\n\n    sign_count: previously_stored_sign_count,\n    signature: signature # URL-safe Base64 encoded\n  )\n  context.sign_count # =\u003e Integer\nelse\n  # should never happen.\nend\n```\n\nSee sample code in this repository, or [working sample site](https://web-authn.herokuapp.com/).\n\nCurrently, there are several restrictions.\n* only `none` attestation format is supported.\n* only EC key w/ `P-(256|384|521)` public key is supported.\n* authenticator data w/ extensions aren't supported.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `VERSION`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/nov/web_authn.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnov%2Fweb_authn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnov%2Fweb_authn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnov%2Fweb_authn/lists"}