{"id":19465179,"url":"https://github.com/doorkeeper-gem/doorkeeper-jwt","last_synced_at":"2025-08-19T01:07:18.569Z","repository":{"id":29656820,"uuid":"33198643","full_name":"doorkeeper-gem/doorkeeper-jwt","owner":"doorkeeper-gem","description":"JWT Token support for Doorkeeper","archived":false,"fork":false,"pushed_at":"2024-08-20T09:55:24.000Z","size":101,"stargazers_count":221,"open_issues_count":6,"forks_count":45,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-28T14:53:18.804Z","etag":null,"topics":["doorkeeper","jwt","jwt-auth","jwt-token"],"latest_commit_sha":null,"homepage":null,"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/doorkeeper-gem.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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,"zenodo":null}},"created_at":"2015-03-31T17:09:20.000Z","updated_at":"2025-07-24T07:56:07.000Z","dependencies_parsed_at":"2022-09-03T18:01:58.734Z","dependency_job_id":"b3a36026-5cb4-457b-8289-f6c0824b69a5","html_url":"https://github.com/doorkeeper-gem/doorkeeper-jwt","commit_stats":{"total_commits":62,"total_committers":19,"mean_commits":3.263157894736842,"dds":0.6290322580645161,"last_synced_commit":"df50f060c5b568cccab289b38892d35cb42850fb"},"previous_names":["chriswarren/doorkeeper-jwt"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/doorkeeper-gem/doorkeeper-jwt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doorkeeper-gem%2Fdoorkeeper-jwt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doorkeeper-gem%2Fdoorkeeper-jwt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doorkeeper-gem%2Fdoorkeeper-jwt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doorkeeper-gem%2Fdoorkeeper-jwt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doorkeeper-gem","download_url":"https://codeload.github.com/doorkeeper-gem/doorkeeper-jwt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doorkeeper-gem%2Fdoorkeeper-jwt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271083550,"owners_count":24696316,"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","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["doorkeeper","jwt","jwt-auth","jwt-token"],"created_at":"2024-11-10T18:19:05.594Z","updated_at":"2025-08-19T01:07:18.516Z","avatar_url":"https://github.com/doorkeeper-gem.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Gem Version](https://badge.fury.io/rb/doorkeeper-jwt.svg)](https://rubygems.org/gems/doorkeeper-jwt)\n[![Coverage Status](https://coveralls.io/repos/github/doorkeeper-gem/doorkeeper-jwt/badge.svg?branch=master)](https://coveralls.io/github/doorkeeper-gem/doorkeeper-jwt?branch=master)\n[![Build Status](https://travis-ci.org/doorkeeper-gem/doorkeeper-jwt.svg?branch=master)](https://travis-ci.org/doorkeeper-gem/doorkeeper-jwt)\n[![Maintainability](https://api.codeclimate.com/v1/badges/ca4d81b49acabda27e0c/maintainability)](https://codeclimate.com/github/doorkeeper-gem/doorkeeper-jwt/maintainability)\n\n# Doorkeeper::JWT\n\nDoorkeeper JWT adds JWT token support to the Doorkeeper OAuth library. Confirmed to work with Doorkeeper 2.2.x - 4.x.\nUntested with later versions of Doorkeeper.\n\n```ruby\ngem 'doorkeeper'\n```\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'doorkeeper-jwt'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install doorkeeper-jwt\n\n## Usage\n\nIn your `doorkeeper.rb` initializer add the follow to the `Doorkeeper.configure` block:\n\n```ruby\naccess_token_generator '::Doorkeeper::JWT'\n```\n\nThen add a `Doorkeeper::JWT.configure` block below the `Doorkeeper.configure` block to set your JWT preferences.\n\n```ruby\nDoorkeeper::JWT.configure do\n  # Set the payload for the JWT token. This should contain unique information\n  # about the user. Defaults to a randomly generated token in a hash:\n  #     { token: \"RANDOM-TOKEN\" }\n  token_payload do |opts|\n    user = User.find(opts[:resource_owner_id])\n\n    {\n      iss: 'My App',\n      iat: Time.current.utc.to_i,\n      aud: opts[:application][:uid],\n\n      # @see JWT reserved claims - https://tools.ietf.org/html/draft-jones-json-web-token-07#page-7\n      jti: SecureRandom.uuid,\n      sub: user.id,\n\n      user: {\n        id: user.id,\n        email: user.email\n      }\n    }\n  end\n\n  # Optionally set additional headers for the JWT. See\n  # https://tools.ietf.org/html/rfc7515#section-4.1\n  # JWK can be used to automatically verify RS* tokens client-side if token's kid matches a public kid in /oauth/discovery/keys\n  # token_headers do |_opts|\n  #   key = OpenSSL::PKey::RSA.new(File.read(File.join('path', 'to', 'file.pem')))\n  #   { kid: JWT::JWK.new(key)[:kid] }\n  # end\n\n  # Use the application secret specified in the access grant token. Defaults to\n  # `false`. If you specify `use_application_secret true`, both `secret_key` and\n  # `secret_key_path` will be ignored.\n  use_application_secret false\n\n  # Set the signing secret. This would be shared with any other applications\n  # that should be able to verify the authenticity of the token. Defaults to \"secret\".\n  secret_key ENV['JWT_SECRET']\n\n  # If you want to use RS* algorithms specify the path to the RSA key to use for\n  # signing. If you specify a `secret_key_path` it will be used instead of\n  # `secret_key`.\n  secret_key_path File.join('path', 'to', 'file.pem')\n\n  # Specify cryptographic signing algorithm type (https://github.com/progrium/ruby-jwt). Defaults to\n  # `nil`.\n  signing_method :hs512\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt\nthat 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\nversion number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git\ncommits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\n1. Fork it (https://github.com/[my-github-username]/doorkeeper-jwt/fork)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoorkeeper-gem%2Fdoorkeeper-jwt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoorkeeper-gem%2Fdoorkeeper-jwt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoorkeeper-gem%2Fdoorkeeper-jwt/lists"}