https://github.com/omniauth/omniauth-oauth2
An abstract OAuth2 strategy for OmniAuth.
https://github.com/omniauth/omniauth-oauth2
Keywords
authentication hacktoberfest oauth2 omniauth omniauth-strategy
Keywords from Contributors
activerecord activejob mvc rubygems rack rspec hash-extensions sinatra grape authorization
Last synced: about 3 hours ago
JSON representation
Repository metadata
An abstract OAuth2 strategy for OmniAuth.
- Host: GitHub
- URL: https://github.com/omniauth/omniauth-oauth2
- Owner: omniauth
- License: mit
- Created: 2011-09-28T16:48:31.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2025-12-11T15:23:48.000Z (3 months ago)
- Last Synced: 2026-01-28T23:47:02.804Z (about 1 month ago)
- Topics: authentication, hacktoberfest, oauth2, omniauth, omniauth-strategy
- Language: Ruby
- Homepage:
- Size: 163 KB
- Stars: 509
- Watchers: 6
- Forks: 301
- Open Issues: 54
- Releases: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Security: SECURITY.md
README.md
OmniAuth OAuth2
This gem contains a generic OAuth2 strategy for OmniAuth. It is meant to serve
as a building block strategy for other strategies and not to be used
independently (since it has no inherent way to gather uid and user info).
Creating an OAuth2 Strategy
To create an OmniAuth OAuth2 strategy using this gem, you can simply subclass
it and add a few extra methods like so:
require 'omniauth-oauth2'
module OmniAuth
module Strategies
class SomeSite < OmniAuth::Strategies::OAuth2
# Give your strategy a name.
option :name, "some_site"
# This is where you pass the options you would pass when
# initializing your consumer from the OAuth gem.
option :client_options, {:site => "https://api.somesite.com"}
# You may specify that your strategy should use PKCE by setting
# the pkce option to true: https://tools.ietf.org/html/rfc7636
option :pkce, true
# These are called after authentication has succeeded. If
# possible, you should try to set the UID without making
# additional calls (if the user id is returned with the token
# or as a URI parameter). This may not be possible with all
# providers.
uid{ raw_info['id'] }
info do
{
:name => raw_info['name'],
:email => raw_info['email']
}
end
extra do
{
'raw_info' => raw_info
}
end
def raw_info
@raw_info ||= access_token.get('/me').parsed
end
end
end
end
That's pretty much it!
OmniAuth-OAuth2 for Enterprise
Available as part of the Tidelift Subscription.
The 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.
Supported Ruby Versions
OmniAuth is tested under 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, truffleruby, and JRuby.
Owner metadata
- Name: OmniAuth Community
- Login: omniauth
- Email:
- Kind: organization
- Description:
- Website:
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/17064356?v=4
- Repositories: 21
- Last ynced at: 2024-03-25T19:32:34.895Z
- Profile URL: https://github.com/omniauth
GitHub Events
Total
- Pull request event: 2
- Fork event: 6
- Watch event: 10
- Issue comment event: 3
- Push event: 1
- Pull request review event: 1
Last Year
- Pull request event: 1
- Fork event: 2
- Watch event: 5
- Issue comment event: 2
- Push event: 1
Committers metadata
Last synced: 2 days ago
Total Commits: 183
Total Committers: 39
Avg Commits per committer: 4.692
Development Distribution Score (DDS): 0.776
Commits in past year: 3
Committers in past year: 1
Avg Commits per committer in past year: 3.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| Erik Michaels-Ober | s****k@g****m | 41 |
| tmilewski | t****i@g****m | 23 |
| Michael Bleigh | m****l@i****m | 22 |
| Yoran Brondsema | y****n@h****o | 21 |
| Bobby McDonald | b****o@g****m | 17 |
| AlexanderPavlenko | a****o@r****u | 5 |
| nov | n****v@m****p | 5 |
| Peter M. Goldstein | p****n@g****m | 4 |
| Jack Hartzler | j****r@g****m | 4 |
| Guilherme Simoes | g****s@g****m | 3 |
| Michael Bleigh | m****h@m****m | 3 |
| Jesse Doyle | j****e@a****a | 2 |
| Chef.Delicious.Chen | c****n@g****m | 2 |
| Isaac Sanders | i****c@i****m | 2 |
| Jonathan Julian | j****n@g****m | 2 |
| Mark Dodwell | m****k@m****k | 2 |
| Masafumi Koba | 4****s | 2 |
| Patricio Cano | s****2@g****m | 2 |
| swamp09 | s****a@e****p | 1 |
| Yuji Yaginuma | y****a@g****m | 1 |
| Yauhen Kharuzhy | j****r@g****m | 1 |
| Vokhmin Alexey V | a****n@g****m | 1 |
| Jake Dahn | j****e@a****m | 1 |
| Jerry Cheung | j****h@w****m | 1 |
| Lucas Aragno | l****s@i****m | 1 |
| Markus Koller | m****r@g****m | 1 |
| 王振威 | j****0@g****m | 1 |
| Vesa Vänskä | v****a@v****m | 1 |
| Mohamed Ziata | w****a@g****m | 1 |
| José Valim | j****m@g****m | 1 |
| and 9 more... | ||
Committer domains:
- robbinsweb.biz: 1
- bitdeli.com: 1
- nevir.net: 1
- yandex.ru: 1
- ualberta.ca: 1
- k3integrations.com: 1
- suse.de: 1
- vesavanska.com: 1
- gitlab.com: 1
- iheartjane.com: 1
- whatcodecraves.com: 1
- ansolabs.com: 1
- esm.co.jp: 1
- mkdynamic.co.uk: 1
- isaacbfsanders.com: 1
- ama.ab.ca: 1
- mbleigh.com: 1
- gocaribou.com: 1
- matake.jp: 1
- roundlake.ru: 1
- hstry.co: 1
- intridea.com: 1
Issue and Pull Request metadata
Last synced: about 1 month ago
Total issues: 58
Total pull requests: 65
Average time to close issues: 8 months
Average time to close pull requests: 8 months
Total issue authors: 56
Total pull request authors: 51
Average comments per issue: 5.12
Average comments per pull request: 3.06
Merged pull request: 24
Bot issues: 0
Bot pull requests: 2
Past year issues: 0
Past year pull requests: 1
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 1
Past year average comments per issue: 0
Past year average comments per pull request: 0.0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- dombarnes (2)
- Drblack101 (2)
- ramonpm (1)
- maximveksler (1)
- vpfaulkner (1)
- reiz (1)
- snitko (1)
- homakov (1)
- chabdulbasit17 (1)
- ghost (1)
- perlmunger (1)
- kinitawowi (1)
- snovity (1)
- davetron5000 (1)
- mulka (1)
Top Pull Request Authors
- tmilewski (5)
- BobbyMcWho (3)
- ybiquitous (3)
- nov (3)
- berniechiu (2)
- dependabot[bot] (2)
- coddeys (2)
- dfan1028 (2)
- pierre-pretorius (1)
- coderberry (1)
- dshorthouse (1)
- jasnow (1)
- ernesto-jimenez (1)
- coezbek (1)
- rakibai (1)
Top Issue Labels
Top Pull Request Labels
- dependencies (2)
- hacktoberfest (1)
Package metadata
- Total packages: 12
-
Total downloads:
- rubygems: 340,149,207 total
- Total docker downloads: 1,196,293,422
- Total dependent packages: 996 (may contain duplicates)
- Total dependent repositories: 43,622 (may contain duplicates)
- Total versions: 58
- Total maintainers: 4
- Total advisories: 1
gem.coop: omniauth-oauth2
An abstract OAuth2 strategy for OmniAuth.
- Homepage: https://github.com/omniauth/omniauth-oauth2
- Documentation: http://www.rubydoc.info/gems/omniauth-oauth2/
- Licenses: MIT
- Latest release: 1.9.0 (published 3 months ago)
- Last Synced: 2026-03-01T15:02:55.202Z (2 days ago)
- Versions: 24
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 170,078,168 Total
- Docker Downloads: 598,146,711
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.076%
- Downloads: 0.151%
- Docker downloads count: 0.152%
- Maintainers (4)
rubygems.org: omniauth-oauth2
An abstract OAuth2 strategy for OmniAuth.
- Homepage: https://github.com/omniauth/omniauth-oauth2
- Documentation: http://www.rubydoc.info/gems/omniauth-oauth2/
- Licenses: MIT
- Latest release: 1.9.0 (published 3 months ago)
- Last Synced: 2026-03-01T09:57:13.973Z (2 days ago)
- Versions: 24
- Dependent Packages: 996
- Dependent Repositories: 43,622
- Downloads: 170,071,039 Total
- Docker Downloads: 598,146,711
-
Rankings:
- Dependent packages count: 0.049%
- Downloads: 0.148%
- Dependent repos count: 0.161%
- Docker downloads count: 0.2%
- Average: 0.774%
- Forks count: 1.526%
- Stargazers count: 2.56%
- Maintainers (4)
- Advisories:
ubuntu-23.10: ruby-omniauth-oauth2
- Homepage: https://github.com/omniauth/omniauth-oauth2
- Licenses:
- Latest release: 1.8.0-1 (published 18 days ago)
- Last Synced: 2026-02-13T18:28:05.552Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-10: ruby-omniauth-oauth2
- Homepage: https://github.com/omniauth/omniauth-oauth2
- Documentation: https://packages.debian.org/buster/ruby-omniauth-oauth2
- Licenses:
- Latest release: 1.5.0-1 (published 20 days ago)
- Last Synced: 2026-02-13T04:23:47.682Z (19 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-23.04: ruby-omniauth-oauth2
- Homepage: https://github.com/omniauth/omniauth-oauth2
- Licenses:
- Latest release: 1.8.0-1 (published 20 days ago)
- Last Synced: 2026-02-11T06:45:42.277Z (20 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-11: ruby-omniauth-oauth2
- Homepage: https://github.com/omniauth/omniauth-oauth2
- Documentation: https://packages.debian.org/bullseye/ruby-omniauth-oauth2
- Licenses:
- Latest release: 1.6.0-1 (published 21 days ago)
- Last Synced: 2026-02-13T08:23:08.669Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-20.04: ruby-omniauth-oauth2
- Homepage: https://github.com/omniauth/omniauth-oauth2
- Licenses:
- Latest release: 1.5.0-1 (published 18 days ago)
- Last Synced: 2026-02-13T07:19:12.166Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-24.10: ruby-omniauth-oauth2
- Homepage: https://github.com/omniauth/omniauth-oauth2
- Licenses:
- Latest release: 1.8.0-1 (published 18 days ago)
- Last Synced: 2026-02-13T09:53:52.491Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-22.04: ruby-omniauth-oauth2
- Homepage: https://github.com/omniauth/omniauth-oauth2
- Licenses:
- Latest release: 1.7.1-2 (published 18 days ago)
- Last Synced: 2026-02-13T13:22:06.220Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-12: ruby-omniauth-oauth2
- Homepage: https://github.com/omniauth/omniauth-oauth2
- Documentation: https://packages.debian.org/bookworm/ruby-omniauth-oauth2
- Licenses:
- Latest release: 1.8.0-1 (published 19 days ago)
- Last Synced: 2026-02-12T23:36:54.392Z (19 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
debian-13: ruby-omniauth-oauth2
- Homepage: https://github.com/omniauth/omniauth-oauth2
- Documentation: https://packages.debian.org/trixie/ruby-omniauth-oauth2
- Licenses: mit
- Latest release: 1.8.0-1 (published 19 days ago)
- Last Synced: 2026-02-13T13:18:07.282Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
Dependencies
- coveralls_reborn ~> 0.19.0 development
- rack-test >= 0 development
- rspec ~> 3.2 development
- simplecov-lcov >= 0 development
- webmock ~> 3.0 development
- rake ~> 13.0
- bundler ~> 2.0 development
- oauth2 >= 1.4, < 3
- omniauth ~> 2.0
- actions/checkout v2 composite
- coverallsapp/github-action v1.1.2 composite
- ruby/setup-ruby v1 composite
Score: 31.14960631204823