{"id":13877930,"url":"https://github.com/omniauth/omniauth-oauth2","last_synced_at":"2025-05-14T06:11:46.631Z","repository":{"id":37405753,"uuid":"2476301","full_name":"omniauth/omniauth-oauth2","owner":"omniauth","description":"An abstract OAuth2 strategy for OmniAuth.","archived":false,"fork":false,"pushed_at":"2024-09-03T22:26:17.000Z","size":166,"stargazers_count":504,"open_issues_count":55,"forks_count":305,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-06T13:43:34.234Z","etag":null,"topics":["authentication","hacktoberfest","oauth2","omniauth","omniauth-strategy"],"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/omniauth.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"bobbymcwho","tidelift":"rubygems/omniauth-oauth2"}},"created_at":"2011-09-28T16:48:31.000Z","updated_at":"2025-04-05T15:28:10.000Z","dependencies_parsed_at":"2023-07-14T19:00:20.465Z","dependency_job_id":"bdf0b941-47e9-4917-aa9f-97c6e53d2c25","html_url":"https://github.com/omniauth/omniauth-oauth2","commit_stats":{"total_commits":180,"total_committers":40,"mean_commits":4.5,"dds":0.7722222222222223,"last_synced_commit":"c830138e399b207ad3ce832ed4db51e67030cdcb"},"previous_names":["intridea/omniauth-oauth2"],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omniauth%2Fomniauth-oauth2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omniauth%2Fomniauth-oauth2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omniauth%2Fomniauth-oauth2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omniauth%2Fomniauth-oauth2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omniauth","download_url":"https://codeload.github.com/omniauth/omniauth-oauth2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247539053,"owners_count":20955229,"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":["authentication","hacktoberfest","oauth2","omniauth","omniauth-strategy"],"created_at":"2024-08-06T08:01:35.218Z","updated_at":"2025-04-10T23:22:29.317Z","avatar_url":"https://github.com/omniauth.png","language":"Ruby","funding_links":["https://github.com/sponsors/bobbymcwho","https://tidelift.com/funding/github/rubygems/omniauth-oauth2","https://tidelift.com/subscription/pkg/rubygems-omniauth-oauth2?utm_source=undefined\u0026utm_medium=referral\u0026utm_campaign=enterprise"],"categories":["Ruby"],"sub_categories":[],"readme":"# OmniAuth OAuth2\n\n[![Gem Version](http://img.shields.io/gem/v/omniauth-oauth2.svg)][gem]\n[![Code Climate](http://img.shields.io/codeclimate/maintainability/intridea/omniauth-oauth2.svg)][codeclimate]\n[![Coverage Status](http://img.shields.io/coveralls/intridea/omniauth-oauth2.svg)][coveralls]\n[![Security](https://hakiri.io/github/omniauth/omniauth-oauth2/master.svg)](https://hakiri.io/github/omniauth/omniauth-oauth2/master)\n\n[gem]: https://rubygems.org/gems/omniauth-oauth2\n[codeclimate]: https://codeclimate.com/github/intridea/omniauth-oauth2\n[coveralls]: https://coveralls.io/r/intridea/omniauth-oauth2\n\nThis gem contains a generic OAuth2 strategy for OmniAuth. It is meant to serve\nas a building block strategy for other strategies and not to be used\nindependently (since it has no inherent way to gather uid and user info).\n\n## Creating an OAuth2 Strategy\n\nTo create an OmniAuth OAuth2 strategy using this gem, you can simply subclass\nit and add a few extra methods like so:\n\n```ruby\nrequire 'omniauth-oauth2'\n\nmodule OmniAuth\n  module Strategies\n    class SomeSite \u003c OmniAuth::Strategies::OAuth2\n      # Give your strategy a name.\n      option :name, \"some_site\"\n\n      # This is where you pass the options you would pass when\n      # initializing your consumer from the OAuth gem.\n      option :client_options, {:site =\u003e \"https://api.somesite.com\"}\n\n      # You may specify that your strategy should use PKCE by setting\n      # the pkce option to true: https://tools.ietf.org/html/rfc7636\n      option :pkce, true\n\n      # These are called after authentication has succeeded. If\n      # possible, you should try to set the UID without making\n      # additional calls (if the user id is returned with the token\n      # or as a URI parameter). This may not be possible with all\n      # providers.\n      uid{ raw_info['id'] }\n\n      info do\n        {\n          :name =\u003e raw_info['name'],\n          :email =\u003e raw_info['email']\n        }\n      end\n\n      extra do\n        {\n          'raw_info' =\u003e raw_info\n        }\n      end\n\n      def raw_info\n        @raw_info ||= access_token.get('/me').parsed\n      end\n    end\n  end\nend\n```\n\nThat's pretty much it!\n\n## OmniAuth-OAuth2 for Enterprise\n\nAvailable as part of the Tidelift Subscription.\n\nThe maintainers of OmniAuth-OAuth2 and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. [Learn more.](https://tidelift.com/subscription/pkg/rubygems-omniauth-oauth2?utm_source=undefined\u0026utm_medium=referral\u0026utm_campaign=enterprise)\n\n## Supported Ruby Versions\n\nOmniAuth is tested under 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, truffleruby, and JRuby.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomniauth%2Fomniauth-oauth2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomniauth%2Fomniauth-oauth2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomniauth%2Fomniauth-oauth2/lists"}