oauth2 2.0.9 → 2.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -1,346 +1,296 @@
1
- <p align="center">
2
- <a href="http://oauth.net/2/" target="_blank" rel="noopener">
3
- <img src="https://github.com/oauth-xx/oauth2/raw/main/docs/images/logo/oauth2-logo-124px.png?raw=true" alt="OAuth 2.0 Logo by Chris Messina, CC BY-SA 3.0">
4
- </a>
5
- <a href="https://www.ruby-lang.org/" target="_blank" rel="noopener">
6
- <img width="124px" src="https://github.com/oauth-xx/oauth2/raw/main/docs/images/logo/ruby-logo-198px.svg?raw=true" alt="Yukihiro Matsumoto, Ruby Visual Identity Team, CC BY-SA 2.5">
7
- </a>
8
- </p>
1
+ <a href="https://github.com/ruby-oauth"><img alt="ruby-oauth Logo by Aboling0, CC BY-SA 4.0" src="https://logos.galtzo.com/assets/images/ruby-oauth/avatar-128px.svg" width="14%" align="right"/></a>
9
2
 
10
- ## What
3
+ # 🔐 OAuth2
11
4
 
12
- OAuth 2.0 is the industry-standard protocol for authorization.
13
- OAuth 2.0 focuses on client developer simplicity while providing specific authorization flows for web applications,
14
- desktop applications, mobile phones, and living room devices.
15
- This is a RubyGem for implementing OAuth 2.0 clients and servers in Ruby applications.
16
- See the sibling `oauth` gem for OAuth 1.0 implementations in Ruby.
5
+ [![Version][👽versioni]][👽version] [![GitHub tag (latest SemVer)][⛳️tag-img]][⛳️tag] [![License: MIT][📄license-img]][📄license] [![Downloads Rank][👽dl-ranki]][👽dl-rank] [![CodeCov Test Coverage][🏀codecovi]][🏀codecov] [![Coveralls Test Coverage][🏀coveralls-img]][🏀coveralls] [![QLTY Test Coverage][🏀qlty-covi]][🏀qlty-cov] [![QLTY Maintainability][🏀qlty-mnti]][🏀qlty-mnt] [![CI Heads][🚎3-hd-wfi]][🚎3-hd-wf] [![CI Runtime Dependencies @ HEAD][🚎12-crh-wfi]][🚎12-crh-wf] [![CI Current][🚎11-c-wfi]][🚎11-c-wf] [![CI Truffle Ruby][🚎9-t-wfi]][🚎9-t-wf] [![CI JRuby][🚎10-j-wfi]][🚎10-j-wf] [![Deps Locked][🚎13-🔒️-wfi]][🚎13-🔒️-wf] [![Deps Unlocked][🚎14-🔓️-wfi]][🚎14-🔓️-wf] [![CI Test Coverage][🚎2-cov-wfi]][🚎2-cov-wf] [![CI Style][🚎5-st-wfi]][🚎5-st-wf] [![Apache SkyWalking Eyes License Compatibility Check][🚎15-🪪-wfi]][🚎15-🪪-wf]
6
+
7
+ `if ci_badges.map(&:color).detect { it != "green"}` ☝️ [let me know][✉️discord-invite], as I may have missed the [discord notification][✉️discord-invite].
17
8
 
18
9
  ---
19
10
 
20
- * [OAuth 2.0 Spec][oauth2-spec]
21
- * [oauth sibling gem][sibling-gem] for OAuth 1.0 implementations in Ruby.
11
+ `if ci_badges.map(&:color).all? { it == "green"}` 👇️ send money so I can do more of this. FLOSS maintenance is now my full-time job.
22
12
 
23
- [oauth2-spec]: https://oauth.net/2/
24
- [sibling-gem]: https://gitlab.com/oauth-xx/oauth
13
+ [![OpenCollective Backers][🖇osc-backers-i]][🖇osc-backers] [![OpenCollective Sponsors][🖇osc-sponsors-i]][🖇osc-sponsors] [![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor] [![Liberapay Goal Progress][⛳liberapay-img]][⛳liberapay] [![Donate on PayPal][🖇paypal-img]][🖇paypal] [![Buy me a coffee][🖇buyme-small-img]][🖇buyme] [![Donate on Polar][🖇polar-img]][🖇polar] [![Donate at ko-fi.com][🖇kofi-img]][🖇kofi]
25
14
 
26
- ## Release Documentation
15
+ <details>
16
+ <summary>👣 How will this project approach the September 2025 hostile takeover of RubyGems? 🚑️</summary>
27
17
 
28
- ### Version 2.0.x
18
+ I've summarized my thoughts in [this blog post](https://dev.to/galtzo/hostile-takeover-of-rubygems-my-thoughts-5hlo).
29
19
 
30
- <details>
31
- <summary>2.0.x Readmes</summary>
32
-
33
- | Version | Release Date | Readme |
34
- |---------|--------------|----------------------------------------------------------|
35
- | 2.0.9 | 2022-09-16 | https://gitlab.com/oauth-xx/oauth2/-/blob/v2.0.9/README.md |
36
- | 2.0.8 | 2022-09-01 | https://gitlab.com/oauth-xx/oauth2/-/blob/v2.0.8/README.md |
37
- | 2.0.7 | 2022-08-22 | https://gitlab.com/oauth-xx/oauth2/-/blob/v2.0.7/README.md |
38
- | 2.0.6 | 2022-07-13 | https://gitlab.com/oauth-xx/oauth2/-/blob/v2.0.6/README.md |
39
- | 2.0.5 | 2022-07-07 | https://gitlab.com/oauth-xx/oauth2/-/blob/v2.0.5/README.md |
40
- | 2.0.4 | 2022-07-01 | https://gitlab.com/oauth-xx/oauth2/-/blob/v2.0.4/README.md |
41
- | 2.0.3 | 2022-06-28 | https://gitlab.com/oauth-xx/oauth2/-/blob/v2.0.3/README.md |
42
- | 2.0.2 | 2022-06-24 | https://gitlab.com/oauth-xx/oauth2/-/blob/v2.0.2/README.md |
43
- | 2.0.1 | 2022-06-22 | https://gitlab.com/oauth-xx/oauth2/-/blob/v2.0.1/README.md |
44
- | 2.0.0 | 2022-06-21 | https://gitlab.com/oauth-xx/oauth2/-/blob/v2.0.0/README.md |
45
20
  </details>
46
21
 
47
- ### Older Releases
22
+ ## 🌻 Synopsis <a href="https://discord.gg/3qme4XHNKN"><img alt="Galtzo FLOSS Logo by Aboling0, CC BY-SA 4.0" src="https://logos.galtzo.com/assets/images/galtzo-floss/avatar-128px.svg" width="8%" align="right"/></a> <a href="https://ruby-toolbox.com"><img alt="ruby-lang Logo, Yukihiro Matsumoto, Ruby Visual Identity Team, CC BY-SA 2.5" src="https://logos.galtzo.com/assets/images/ruby-lang/avatar-128px.svg" width="8%" align="right"/></a>
48
23
 
49
- <details>
50
- <summary>1.4.x Readmes</summary>
51
-
52
- | Version | Release Date | Readme |
53
- |---------|--------------|-------------------------------------------------------------|
54
- | 1.4.11 | Sep 16, 2022 | https://gitlab.com/oauth-xx/oauth2/-/blob/v1.4.11/README.md |
55
- | 1.4.10 | Jul 1, 2022 | https://gitlab.com/oauth-xx/oauth2/-/blob/v1.4.10/README.md |
56
- | 1.4.9 | Feb 20, 2022 | https://gitlab.com/oauth-xx/oauth2/-/blob/v1.4.9/README.md |
57
- | 1.4.8 | Feb 18, 2022 | https://gitlab.com/oauth-xx/oauth2/-/blob/v1.4.8/README.md |
58
- | 1.4.7 | Mar 19, 2021 | https://gitlab.com/oauth-xx/oauth2/-/blob/v1.4.7/README.md |
59
- | 1.4.6 | Mar 19, 2021 | https://gitlab.com/oauth-xx/oauth2/-/blob/v1.4.6/README.md |
60
- | 1.4.5 | Mar 18, 2021 | https://gitlab.com/oauth-xx/oauth2/-/blob/v1.4.5/README.md |
61
- | 1.4.4 | Feb 12, 2020 | https://gitlab.com/oauth-xx/oauth2/-/blob/v1.4.4/README.md |
62
- | 1.4.3 | Jan 29, 2020 | https://gitlab.com/oauth-xx/oauth2/-/blob/v1.4.3/README.md |
63
- | 1.4.2 | Oct 1, 2019 | https://gitlab.com/oauth-xx/oauth2/-/blob/v1.4.2/README.md |
64
- | 1.4.1 | Oct 13, 2018 | https://gitlab.com/oauth-xx/oauth2/-/blob/v1.4.1/README.md |
65
- | 1.4.0 | Jun 9, 2017 | https://gitlab.com/oauth-xx/oauth2/-/blob/v1.4.0/README.md |
66
- </details>
24
+ OAuth 2.0 is the industry-standard protocol for authorization.
25
+ This is a RubyGem for implementing OAuth 2.0 clients (not servers) in Ruby applications.
67
26
 
68
- <details>
69
- <summary>1.3.x Readmes</summary>
27
+ ⭐️ including OAuth 2.1 draft spec & OpenID Connect (OIDC)
70
28
 
71
- | Version | Release Date | Readme |
72
- |----------|--------------|----------------------------------------------------------|
73
- | 1.3.1 | Mar 3, 2017 | https://gitlab.com/oauth-xx/oauth2/-/blob/v1.3.1/README.md |
74
- | 1.3.0 | Dec 27, 2016 | https://gitlab.com/oauth-xx/oauth2/-/blob/v1.3.0/README.md |
75
- </details>
29
+ ### Quick Examples
76
30
 
77
- <details>
78
- <summary>&le;= 1.2.x Readmes (2016 and before)</summary>
79
-
80
- | Version | Release Date | Readme |
81
- |----------|--------------|----------------------------------------------------------|
82
- | 1.2.0 | Jun 30, 2016 | https://gitlab.com/oauth-xx/oauth2/-/blob/v1.2.0/README.md |
83
- | 1.1.0 | Jan 30, 2016 | https://gitlab.com/oauth-xx/oauth2/-/blob/v1.1.0/README.md |
84
- | 1.0.0 | May 23, 2014 | https://gitlab.com/oauth-xx/oauth2/-/blob/v1.0.0/README.md |
85
- | < 1.0.0 | Find here | https://gitlab.com/oauth-xx/oauth2/-/tags |
86
- </details>
31
+ <details markdown="1">
32
+ <summary>Convert the following `curl` command into a token request using this gem...</summary>
87
33
 
88
- ## Status
89
-
90
- <!--
91
- Numbering rows and badges in each row as a visual "database" lookup,
92
- as the table is extremely dense, and it can be very difficult to find anything
93
- Putting one on each row here, to document the emoji that should be used, and for ease of copy/paste.
94
-
95
- row #s:
96
- 1️⃣
97
- 2️⃣
98
- 3️⃣
99
- 4️⃣
100
- 5️⃣
101
- 6️⃣
102
- 7️⃣
103
-
104
- badge #s:
105
- ⛳️
106
- 🖇
107
- 🏘
108
- 🚎
109
- 🖐
110
- 🧮
111
- 📗
112
-
113
- appended indicators:
114
- ♻️ - URL needs to be updated from SASS integration. Find / Replace is insufficient.
115
- -->
116
-
117
- | | Project | bundle add oauth2 |
118
- |:----|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
119
- | 1️⃣ | name, license, docs | [![RubyGems.org][⛳️name-img]][⛳️gem] [![License: MIT][🖇src-license-img]][🖇src-license] [![FOSSA][🏘fossa-img]][🏘fossa] [![RubyDoc.info][🚎yard-img]][🚎yard] [![InchCI][🖐inch-ci-img]][🚎yard] |
120
- | 2️⃣ | version & activity | [![Gem Version][⛳️version-img]][⛳️gem] [![Total Downloads][🖇DL-total-img]][⛳️gem] [![Download Rank][🏘DL-rank-img]][⛳️gem] [![Source Code][🚎src-home-img]][🚎src-home] |
121
- | 3️⃣ | maintanence & linting | [![Maintainability][⛳cclim-maint-img♻️]][⛳cclim-maint] [![Helpers][🖇triage-help-img]][🖇triage-help] [![Depfu][🏘depfu-img♻️]][🏘depfu♻️] [![Contributors][🚎contributors-img]][🚎contributors] [![Style][🖐style-wf-img]][🖐style-wf] [![Kloc Roll][🧮kloc-img]][🧮kloc] |
122
- | 4️⃣ | testing | [![Supported][🏘sup-wf-img]][🏘sup-wf] [![Heads][🚎heads-wf-img]][🚎heads-wf] [![Unofficial Support][🖐uns-wf-img]][🖐uns-wf] [![MacOS][🧮mac-wf-img]][🧮mac-wf] [![Windows][📗win-wf-img]][📗win-wf] |
123
- | 5️⃣ | coverage & security | [![CodeClimate][⛳cclim-cov-img♻️]][⛳cclim-cov] [![CodeCov][🖇codecov-img♻️]][🖇codecov] [![Coveralls][🏘coveralls-img]][🏘coveralls] [![Security Policy][🚎sec-pol-img]][🚎sec-pol] [![CodeQL][🖐codeQL-img]][🖐codeQL] [![Code Coverage][🧮cov-wf-img]][🧮cov-wf] |
124
- | 6️⃣ | resources | [![Discussion][⛳gg-discussions-img]][⛳gg-discussions] [![Get help on Codementor][🖇codementor-img]][🖇codementor] [![Chat][🏘chat-img]][🏘chat] [![Blog][🚎blog-img]][🚎blog] [![Blog][🖐wiki-img]][🖐wiki] |
125
- | 7️⃣ | spread 💖 | [![Liberapay Patrons][⛳liberapay-img]][⛳liberapay] [![Sponsor Me][🖇sponsor-img]][🖇sponsor] [![Tweet @ Peter][🏘tweet-img]][🏘tweet] [🌏][aboutme] [👼][angelme] [💻][coderme] |
126
-
127
- <!--
128
- The link tokens in the following sections should be kept ordered by the row and badge numbering scheme
129
- -->
130
-
131
- <!-- 1️⃣ name, license, docs -->
132
- [⛳️gem]: https://rubygems.org/gems/oauth2
133
- [⛳️name-img]: https://img.shields.io/badge/name-oauth2-brightgreen.svg?style=flat
134
- [🖇src-license]: https://opensource.org/licenses/MIT
135
- [🖇src-license-img]: https://img.shields.io/badge/License-MIT-green.svg
136
- [🏘fossa]: https://app.fossa.io/projects/git%2Bgithub.com%2Foauth-xx%2Foauth2?ref=badge_shield
137
- [🏘fossa-img]: https://app.fossa.io/api/projects/git%2Bgithub.com%2Foauth-xx%2Foauth2.svg?type=shield
138
- [🚎yard]: https://www.rubydoc.info/github/oauth-xx/oauth2
139
- [🚎yard-img]: https://img.shields.io/badge/documentation-rubydoc-brightgreen.svg?style=flat
140
- [🖐inch-ci-img]: http://inch-ci.org/github/oauth-xx/oauth2.png
141
-
142
- <!-- 2️⃣ version & activity -->
143
- [⛳️version-img]: http://img.shields.io/gem/v/oauth2.svg
144
- [🖇DL-total-img]: https://img.shields.io/gem/dt/oauth2.svg
145
- [🏘DL-rank-img]: https://img.shields.io/gem/rt/oauth2.svg
146
- [🚎src-home]: https://gitlab.com/oauth-xx/oauth2/
147
- [🚎src-home-img]: https://img.shields.io/badge/source-gitlab-blue.svg?style=flat
148
-
149
- <!-- 3️⃣ maintenance & linting -->
150
- [⛳cclim-maint]: https://codeclimate.com/github/oauth-xx/oauth2/maintainability
151
- [⛳cclim-maint-img♻️]: https://api.codeclimate.com/v1/badges/688c612528ff90a46955/maintainability
152
- [🖇triage-help]: https://www.codetriage.com/oauth-xx/oauth2
153
- [🖇triage-help-img]: https://www.codetriage.com/oauth-xx/oauth2/badges/users.svg
154
- [🏘depfu♻️]: https://depfu.com/github/oauth-xx/oauth2?project_id=4445
155
- [🏘depfu-img♻️]: https://badges.depfu.com/badges/6d34dc1ba682bbdf9ae2a97848241743/count.svg
156
- [🚎contributors]: https://gitlab.com/oauth-xx/oauth2/-/graphs/main
157
- [🚎contributors-img]: https://img.shields.io/github/contributors-anon/oauth-xx/oauth2
158
- [🖐style-wf]: https://github.com/oauth-xx/oauth2/actions/workflows/style.yml
159
- [🖐style-wf-img]: https://github.com/oauth-xx/oauth2/actions/workflows/style.yml/badge.svg
160
- [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
161
- [🧮kloc-img]: https://img.shields.io/tokei/lines/github.com/oauth-xx/oauth2
162
-
163
- <!-- 4️⃣ testing -->
164
- [🏘sup-wf]: https://github.com/oauth-xx/oauth2/actions/workflows/supported.yml
165
- [🏘sup-wf-img]: https://github.com/oauth-xx/oauth2/actions/workflows/supported.yml/badge.svg
166
- [🚎heads-wf]: https://github.com/oauth-xx/oauth2/actions/workflows/heads.yml
167
- [🚎heads-wf-img]: https://github.com/oauth-xx/oauth2/actions/workflows/heads.yml/badge.svg
168
- [🖐uns-wf]: https://github.com/oauth-xx/oauth2/actions/workflows/unsupported.yml
169
- [🖐uns-wf-img]: https://github.com/oauth-xx/oauth2/actions/workflows/unsupported.yml/badge.svg
170
- [🧮mac-wf]: https://github.com/oauth-xx/oauth2/actions/workflows/macos.yml
171
- [🧮mac-wf-img]: https://github.com/oauth-xx/oauth2/actions/workflows/macos.yml/badge.svg
172
- [📗win-wf]: https://github.com/oauth-xx/oauth2/actions/workflows/windows.yml
173
- [📗win-wf-img]: https://github.com/oauth-xx/oauth2/actions/workflows/windows.yml/badge.svg
174
-
175
- <!-- 5️⃣ coverage & security -->
176
- [⛳cclim-cov]: https://codeclimate.com/github/oauth-xx/oauth2/test_coverage
177
- [⛳cclim-cov-img♻️]: https://api.codeclimate.com/v1/badges/688c612528ff90a46955/test_coverage
178
- [🖇codecov-img♻️]: https://codecov.io/gh/oauth-xx/oauth2/branch/main/graph/badge.svg?token=bNqSzNiuo2
179
- [🖇codecov]: https://codecov.io/gh/oauth-xx/oauth2
180
- [🏘coveralls]: https://coveralls.io/github/oauth-xx/oauth2?branch=main
181
- [🏘coveralls-img]: https://coveralls.io/repos/github/oauth-xx/oauth2/badge.svg?branch=main
182
- [🚎sec-pol]: https://gitlab.com/oauth-xx/oauth2/-/blob/main/SECURITY.md
183
- [🚎sec-pol-img]: https://img.shields.io/badge/security-policy-brightgreen.svg?style=flat
184
- [🖐codeQL]: https://github.com/oauth-xx/oauth2/security/code-scanning
185
- [🖐codeQL-img]: https://github.com/oauth-xx/oauth2/actions/workflows/codeql-analysis.yml/badge.svg
186
- [🧮cov-wf]: https://github.com/oauth-xx/oauth2/actions/workflows/coverage.yml
187
- [🧮cov-wf-img]: https://github.com/oauth-xx/oauth2/actions/workflows/coverage.yml/badge.svg
188
-
189
- <!-- 6️⃣ resources -->
190
- [⛳gg-discussions]: https://groups.google.com/g/oauth-ruby
191
- [⛳gg-discussions-img]: https://img.shields.io/badge/google-group-purple.svg?style=flat
192
- [🖇codementor]: https://www.codementor.io/peterboling?utm_source=github&utm_medium=button&utm_term=peterboling&utm_campaign=github
193
- [🖇codementor-img]: https://cdn.codementor.io/badges/get_help_github.svg
194
- [🏘chat]: https://gitter.im/oauth-xx/oauth2
195
- [🏘chat-img]: https://img.shields.io/gitter/room/oauth-xx/oauth2.svg
196
- [🚎blog]: http://www.railsbling.com/tags/oauth2/
197
- [🚎blog-img]: https://img.shields.io/badge/blog-railsbling-brightgreen.svg?style=flat
198
- [🖐wiki]: https://gitlab.com/oauth-xx/oauth2/-/wikis/home
199
- [🖐wiki-img]: https://img.shields.io/badge/wiki-examples-brightgreen.svg?style=flat
200
-
201
- <!-- 7️⃣ spread 💖 -->
202
- [⛳liberapay-img]: https://img.shields.io/liberapay/patrons/pboling.svg?logo=liberapay
203
- [⛳liberapay]: https://liberapay.com/pboling/donate
204
- [🖇sponsor-img]: https://img.shields.io/badge/sponsor-pboling.svg?style=social&logo=github
205
- [🖇sponsor]: https://github.com/sponsors/pboling
206
- [🏘tweet-img]: https://img.shields.io/twitter/follow/galtzo.svg?style=social&label=Follow
207
- [🏘tweet]: http://twitter.com/galtzo
34
+ ```shell
35
+ curl --request POST \
36
+ --url 'https://login.microsoftonline.com/REDMOND_REDACTED/oauth2/token' \
37
+ --header 'content-type: application/x-www-form-urlencoded' \
38
+ --data grant_type=client_credentials \
39
+ --data client_id=REDMOND_CLIENT_ID \
40
+ --data client_secret=REDMOND_CLIENT_SECRET \
41
+ --data resource=REDMOND_RESOURCE_UUID
42
+ ```
208
43
 
209
- <!-- Maintainer Contact Links -->
210
- [railsbling]: http://www.railsbling.com
211
- [peterboling]: http://www.peterboling.com
212
- [aboutme]: https://about.me/peter.boling
213
- [angelme]: https://angel.co/peter-boling
214
- [coderme]:http://coderwall.com/pboling
44
+ NOTE: In the ruby version below, certain params are passed to the `get_token` call, instead of the client creation.
215
45
 
216
- ## Installation
46
+ ```ruby
47
+ client = OAuth2::Client.new(
48
+ "REDMOND_CLIENT_ID", # client_id
49
+ "REDMOND_CLIENT_SECRET", # client_secret
50
+ auth_scheme: :request_body, # Other modes are supported: :basic_auth, :tls_client_auth, :private_key_jwt
51
+ token_url: "oauth2/token", # relative path, except with leading `/`, then absolute path
52
+ site: "https://login.microsoftonline.com/REDMOND_REDACTED"
53
+ )
54
+ client.
55
+ client_credentials. # There are many other types to choose from!
56
+ get_token(resource: "REDMOND_RESOURCE_UUID")
57
+ ```
217
58
 
218
- Install the gem and add to the application's Gemfile by executing:
59
+ NOTE: `header` - The content type specified in the `curl` is already the default!
219
60
 
220
- $ bundle add oauth2
61
+ </details>
221
62
 
222
- If bundler is not being used to manage dependencies, install the gem by executing:
63
+ <details markdown="1">
64
+ <summary>Complete E2E single file script against mock-oauth2-server</summary>
223
65
 
224
- $ gem install oauth2
66
+ - E2E example uses [navikt/mock-oauth2-server](https://github.com/navikt/mock-oauth2-server), which was added in v2.0.11
67
+ - E2E example does not ship with the released gem, so clone the source to play with it.
225
68
 
226
- ## OAuth2 for Enterprise
69
+ ```console
70
+ docker compose -f docker-compose-ssl.yml up -d --wait
71
+ ruby examples/e2e.rb
72
+ # If your machine is slow or Docker pulls are cold, increase the wait:
73
+ E2E_WAIT_TIMEOUT=120 ruby examples/e2e.rb
74
+ # The mock server serves HTTP on 8080; the example points to http://localhost:8080 by default.
75
+ ```
227
76
 
228
- Available as part of the Tidelift Subscription.
77
+ The output should be something like this:
229
78
 
230
- The maintainers of 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.][tidelift-ref]
79
+ ```console
80
+ ➜ ruby examples/e2e.rb
81
+ Access token (truncated): eyJraWQiOiJkZWZhdWx0...
82
+ userinfo status: 200
83
+ userinfo body: {"sub" => "demo-sub", "aud" => ["demo-aud"], "nbf" => 1757816758000, "iss" => "http://localhost:8080/default", "exp" => 1757820358000, "iat" => 1757816758000, "jti" => "d63b97a7-ebe5-4dea-93e6-d542caba6104"}
84
+ E2E complete
85
+ ```
231
86
 
232
- [tidelift-ref]: https://tidelift.com/subscription/pkg/rubygems-oauth2?utm_source=rubygems-oauth2&utm_medium=referral&utm_campaign=enterprise
87
+ Make sure to shut down the mock server when you are done:
233
88
 
234
- ## Security contact information
89
+ ```console
90
+ docker compose -f docker-compose-ssl.yml down
91
+ ```
235
92
 
236
- To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security).
237
- Tidelift will coordinate the fix and disclosure.
93
+ Troubleshooting: validate connectivity to the mock server
94
+
95
+ - Check container status and port mapping:
96
+ - `docker compose -f docker-compose-ssl.yml ps`
97
+ - From the host, try the discovery URL directly (this is what the example uses by default):
98
+ - `curl -v http://localhost:8080/default/.well-known/openid-configuration`
99
+ - If that fails immediately, also try: `curl -v --connect-timeout 2 http://127.0.0.1:8080/default/.well-known/openid-configuration`
100
+ - From inside the container (to distinguish container vs. host networking):
101
+ - `docker exec -it oauth2-mock-oauth2-server-1 curl -v http://127.0.0.1:8080/default/.well-known/openid-configuration`
102
+ - Simple TCP probe from the host:
103
+ - `nc -vz localhost 8080 # or: ruby -rsocket -e 'TCPSocket.new("localhost",8080).close; puts "tcp ok"'`
104
+ - Inspect which host port 8080 is bound to (should be 8080):
105
+ - `docker inspect -f '{{ (index (index .NetworkSettings.Ports "8080/tcp") 0).HostPort }}' oauth2-mock-oauth2-server-1`
106
+ - Look at server logs for readiness/errors:
107
+ - `docker logs -n 200 oauth2-mock-oauth2-server-1`
108
+ - On Linux, ensure nothing else is bound to 8080 and that firewall/SELinux aren’t blocking:
109
+ - `ss -ltnp | grep :8080`
110
+
111
+ Notes
112
+
113
+ - Discovery URL pattern is: `http://localhost:8080/<realm>/.well-known/openid-configuration`, where `<realm>` defaults to `default`.
114
+ - You can change these with env vars when running the example:
115
+ - `E2E_ISSUER_BASE` (default: http://localhost:8080)
116
+ - `E2E_REALM` (default: default)
238
117
 
239
- For more see [SECURITY.md][🚎sec-pol].
118
+ </details>
240
119
 
241
- ## What is new for v2.0?
120
+ ### Alternatives
242
121
 
243
- - Officially support Ruby versions >= 2.7
244
- - Unofficially support Ruby versions >= 2.5
245
- - Incidentally support Ruby versions >= 2.2
246
- - Drop support for the expired MAC Draft (all versions)
247
- - Support IETF rfc7523 JWT Bearer Tokens
248
- - Support IETF rfc7231 Relative Location in Redirect
249
- - Support IETF rfc6749 Don't set oauth params when nil
250
- - Support [OIDC 1.0 Private Key JWT](https://openid.net/specs/openid-connect-core-1_0.html#ClientAuthentication); based on the OAuth JWT assertion specification [(RFC 7523)](https://tools.ietf.org/html/rfc7523)
251
- - Support new formats, including from [jsonapi.org](http://jsonapi.org/format/): `application/vdn.api+json`, `application/vnd.collection+json`, `application/hal+json`, `application/problem+json`
252
- - Adds new option to `OAuth2::Client#get_token`:
253
- - `:access_token_class` (`AccessToken`); user specified class to use for all calls to `get_token`
254
- - Adds new option to `OAuth2::AccessToken#initialize`:
255
- - `:expires_latency` (`nil`); number of seconds by which AccessToken validity will be reduced to offset latency
256
- - By default, keys are transformed to camel case.
257
- - Original keys will still work as previously, in most scenarios, thanks to `rash_alt` gem.
258
- - However, this is a _breaking_ change if you rely on `response.parsed.to_h`, as the keys in the result will be camel case.
259
- - As of version 2.0.4 you can turn key transformation off with the `snaky: false` option.
260
- - By default, the `:auth_scheme` is now `:basic_auth` (instead of `:request_body`)
261
- - Third-party strategies and gems may need to be updated if a provider was requiring client id/secret in the request body
262
- - [... A lot more](https://gitlab.com/oauth-xx/oauth2/-/blob/main/CHANGELOG.md#2.0.0)
122
+ This gem is a low-level OAuth 2.0 **client** (it talks _to_ an authorization server to obtain and use tokens).
123
+ If that isn't quite what you need, one of the following libraries may be a better fit (the first row is this gem for comparison):
263
124
 
264
- ## Compatibility
125
+ | Library | Role | When to use it |
126
+ |-------------------------------------------------------------------|------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
127
+ | **this gem** ([oauth2][📜src-gh]) | OAuth 2.0 / 2.1 + OIDC **client** | You are calling an OAuth 2.0 API, or signing in against a provider, and want a small, dependency-light, spec-faithful client with fine-grained control over the request/response cycle. |
128
+ | [oauth2-mcp][sibling-mcp-gem] | OAuth 2.1 MCP Auth client **and** server | Focused, spec-faithful, MCP Auth client with fine-grained control over the request/response cycle. Rack/Roda compatible clients and servers. Built on top of this gem, [oauth2][📜src-gh]. |
129
+ | [omniauth][omniauth-gem] + [omniauth-oauth2][omniauth-oauth2-gem] | "Log in with…" **client** (Rack) | You primarily want user _authentication_ ("Log in with GitHub/GitLab/Google") wired into a Rack/Rails app via a strategy, rather than driving the token flow yourself. Built on top of this gem, [oauth2][📜src-gh]. |
130
+ | [openid_connect][openid-connect-gem] | OpenID Connect client & server | You need full [OpenID Connect][oidc-spec] (ID-token validation, discovery, userinfo, etc.) with batteries included. Maintained by [@nov][nov]. |
131
+ | [rack-oauth2][rack-oauth2-gem] | OAuth 2.0 client **and** server | You want lower-level Rack primitives, need both client and server pieces, or are building on top of `openid_connect`. Maintained by [@nov][nov]. |
132
+ | [doorkeeper][doorkeeper-gem] | OAuth 2.0 **server / provider** | You want to _be_ the authorization server — issuing tokens to other apps — in a Rails/Grape/Sinatra application, rather than acting as a client. |
133
+ | [oauth][sibling-gem] | OAuth **1.0a** client & server | The provider you integrate with only speaks the older OAuth 1.0a protocol. This is our sibling gem. |
265
134
 
266
- Targeted ruby compatibility is non-EOL versions of Ruby, currently 2.7, 3.0 and
267
- 3.1. Compatibility is further distinguished by supported and unsupported versions of Ruby.
268
- Ruby is limited to 2.2+ for 2.x releases. See `1-4-stable` branch for older rubies.
135
+ See also the [OAuth 2.0 Spec][oauth2-spec], the [OpenID Connect Spec][oidc-spec], and the [MCP Auth Spec][mcp-auth-spec].
269
136
 
270
- <details>
271
- <summary>Ruby Engine Compatibility Policy</summary>
137
+ [oauth2-spec]: https://oauth.net/2/
138
+ [oidc-spec]: https://openid.net/specs/openid-connect-core-1_0.html
139
+ [mcp-auth-spec]: https://modelcontextprotocol.io/specification/draft/basic/authorization
140
+ [sibling-gem]: https://gitlab.com/ruby-oauth/oauth
141
+ [sibling-mcp-gem]: https://github.com/ruby-oauth/oauth2-mcp
142
+ [doorkeeper-gem]: https://github.com/doorkeeper-gem/doorkeeper
143
+ [omniauth-gem]: https://github.com/omniauth/omniauth
144
+ [omniauth-oauth2-gem]: https://github.com/omniauth/omniauth-oauth2
145
+ [openid-connect-gem]: https://github.com/nov/openid_connect
146
+ [rack-oauth2-gem]: https://github.com/nov/rack-oauth2
147
+ [nov]: https://github.com/nov
148
+
149
+ ## 💡 Info you can shake a stick at
150
+
151
+ | Tokens to Remember | [![Gem name][⛳️name-img]][⛳️gem-name] [![Gem namespace][⛳️namespace-img]][⛳️gem-namespace] |
152
+ |-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
153
+ | Works with JRuby | [![JRuby 9.2 Compat][💎jruby-9.2i]][🚎jruby-9.2-wf] [![JRuby 9.3 Compat][💎jruby-9.3i]][🚎jruby-9.3-wf] <br/> [![JRuby 9.4 Compat][💎jruby-9.4i]][🚎jruby-9.4-wf] [![JRuby current Compat][💎jruby-c-i]][🚎10-j-wf] [![JRuby HEAD Compat][💎jruby-headi]][🚎3-hd-wf]|
154
+ | Works with Truffle Ruby | [![Truffle Ruby 22.3 Compat][💎truby-22.3i]][🚎truby-22.3-wf] [![Truffle Ruby 23.0 Compat][💎truby-23.0i]][🚎truby-23.0-wf] [![Truffle Ruby 23.1 Compat][💎truby-23.1i]][🚎truby-23.1-wf] <br/> [![Truffle Ruby 24.2 Compat][💎truby-24.2i]][🚎truby-24.2-wf] [![Truffle Ruby 25.0 Compat][💎truby-25.0i]][🚎truby-25.0-wf] [![Truffle Ruby current Compat][💎truby-c-i]][🚎9-t-wf]|
155
+ | Works with MRI Ruby 4 | [![Ruby 4.0 Compat][💎ruby-4.0i]][🚎11-c-wf] [![Ruby current Compat][💎ruby-c-i]][🚎11-c-wf] [![Ruby HEAD Compat][💎ruby-headi]][🚎3-hd-wf]|
156
+ | Works with MRI Ruby 3 | [![Ruby 3.0 Compat][💎ruby-3.0i]][🚎ruby-3.0-wf] [![Ruby 3.1 Compat][💎ruby-3.1i]][🚎ruby-3.1-wf] [![Ruby 3.2 Compat][💎ruby-3.2i]][🚎ruby-3.2-wf] [![Ruby 3.3 Compat][💎ruby-3.3i]][🚎ruby-3.3-wf] [![Ruby 3.4 Compat][💎ruby-3.4i]][🚎ruby-3.4-wf]|
157
+ | Works with MRI Ruby 2 | ![Ruby 2.2 Compat][💎ruby-2.2i] ![Ruby 2.3 Compat][💎ruby-2.3i] <br/> [![Ruby 2.4 Compat][💎ruby-2.4i]][🚎ruby-2.4-wf] [![Ruby 2.5 Compat][💎ruby-2.5i]][🚎ruby-2.5-wf] [![Ruby 2.6 Compat][💎ruby-2.6i]][🚎ruby-2.6-wf] [![Ruby 2.7 Compat][💎ruby-2.7i]][🚎ruby-2.7-wf]|
158
+ | Support & Community | [![Join Me on Daily.dev's RubyFriends][✉️ruby-friends-img]][✉️ruby-friends] [![Live Chat on Discord][✉️discord-invite-img-ftb]][✉️discord-invite] [![Get help from me on Upwork][👨🏼‍🏫expsup-upwork-img]][👨🏼‍🏫expsup-upwork] [![Get help from me on Codementor][👨🏼‍🏫expsup-codementor-img]][👨🏼‍🏫expsup-codementor] |
159
+ | Source | [![Source on GitLab.com][📜src-gl-img]][📜src-gl] [![Source on CodeBerg.org][📜src-cb-img]][📜src-cb] [![Source on Github.com][📜src-gh-img]][📜src-gh] [![The best SHA: dQw4w9WgXcQ!][🧮kloc-img]][🧮kloc] |
160
+ | Documentation | [![Current release on RubyDoc.info][📜docs-cr-rd-img]][🚎yard-current] [![YARD on Galtzo.com][📜docs-head-rd-img]][🚎yard-head] [![Maintainer Blog][🚂maint-blog-img]][🚂maint-blog] [![GitLab Wiki][📜gl-wiki-img]][📜gl-wiki] [![GitHub Wiki][📜gh-wiki-img]][📜gh-wiki] |
161
+ | Compliance | [![License: MIT][📄license-img]][📄license] [![Apache license compatibility: Category A][📄license-compat-img]][📄license-compat] [![📄ilo-declaration-img]][📄ilo-declaration] [![Security Policy][🔐security-img]][🔐security] [![Contributor Covenant 2.1][🪇conduct-img]][🪇conduct] [![SemVer 2.0.0][📌semver-img]][📌semver] |
162
+ | Style | [![Enforced Code Style Linter][💎rlts-img]][💎rlts] [![Keep-A-Changelog 1.0.0][📗keep-changelog-img]][📗keep-changelog] [![Gitmoji Commits][📌gitmoji-img]][📌gitmoji] [![Compatibility appraised by: appraisal2][💎appraisal2-img]][💎appraisal2] |
163
+ | Maintainer 🎖️ | [![Follow Me on LinkedIn][💖🖇linkedin-img]][💖🖇linkedin] [![Follow Me on Ruby.Social][💖🐘ruby-mast-img]][💖🐘ruby-mast] [![Follow Me on Bluesky][💖🦋bluesky-img]][💖🦋bluesky] [![Contact Maintainer][🚂maint-contact-img]][🚂maint-contact] [![My technical writing][💖💁🏼‍♂️devto-img]][💖💁🏼‍♂️devto] |
164
+ | `...` 💖 | [![Find Me on WellFound:][💖✌️wellfound-img]][💖✌️wellfound] [![Find Me on CrunchBase][💖💲crunchbase-img]][💖💲crunchbase] [![My LinkTree][💖🌳linktree-img]][💖🌳linktree] [![More About Me][💖💁🏼‍♂️aboutme-img]][💖💁🏼‍♂️aboutme] [🧊][💖🧊berg] [🐙][💖🐙hub] [🛖][💖🛖hut] [🧪][💖🧪lab] |
165
+
166
+ ### Compatibility
167
+
168
+ Compatible with MRI Ruby 2.2.0+, and concordant releases of JRuby, and TruffleRuby.
169
+ CI workflows and Appraisals are generated for MRI Ruby 2.4+.
170
+ This test floor is configured by `ruby.test_minimum` in `.kettle-jem.yml` and
171
+ may be higher than the gem's runtime compatibility floor when legacy Rubies are
172
+ not practical for the current toolchain.
173
+
174
+ | 🚚 _Amazing_ test matrix was brought to you by | 🔎 appraisal2 🔎 and the color 💚 green 💚 |
175
+ |------------------------------------------------|--------------------------------------------------------|
176
+ | 👟 Check it out! | ✨ [github.com/appraisal-rb/appraisal2][💎appraisal2] ✨ |
177
+
178
+ ### Federated DVCS
179
+
180
+ <details markdown="1">
181
+ <summary>Find this repo on federated forges (Coming soon!)</summary>
182
+
183
+ | Federated [DVCS][💎d-in-dvcs] Repository | Status | Issues | PRs | Wiki | CI | Discussions |
184
+ |-------------------------------------------------|-----------------------------------------------------------------------|---------------------------|--------------------------|---------------------------|--------------------------|------------------------------|
185
+ | 🧪 [ruby-oauth/oauth2 on GitLab][📜src-gl] | The Truth | [💚][🤝gl-issues] | [💚][🤝gl-pulls] | [💚][📜gl-wiki] | 🐭 Tiny Matrix | ➖ |
186
+ | 🧊 [ruby-oauth/oauth2 on CodeBerg][📜src-cb] | An Ethical Mirror ([Donate][🤝cb-donate]) | [💚][🤝cb-issues] | [💚][🤝cb-pulls] | ➖ | ⭕️ No Matrix | ➖ |
187
+ | 🐙 [ruby-oauth/oauth2 on GitHub][📜src-gh] | Another Mirror | [💚][🤝gh-issues] | [💚][🤝gh-pulls] | [💚][📜gh-wiki] | 💯 Full Matrix | [💚][gh-discussions] |
188
+ | 🎮️ [Discord Server][✉️discord-invite] | [![Live Chat on Discord][✉️discord-invite-img-ftb]][✉️discord-invite] | [Let's][✉️discord-invite] | [talk][✉️discord-invite] | [about][✉️discord-invite] | [this][✉️discord-invite] | [library!][✉️discord-invite] |
272
189
 
273
- This gem is tested against MRI, JRuby, and Truffleruby.
274
- Each of those has varying versions that target a specific version of MRI Ruby.
275
- This gem should work in the just-listed Ruby engines according to the targeted MRI compatibility in the table below.
276
- If you would like to add support for additional engines,
277
- see `gemfiles/README.md`, then submit a PR to the correct maintenance branch as according to the table below.
278
190
  </details>
279
191
 
280
- <details>
281
- <summary>Ruby Version Compatibility Policy</summary>
192
+ [gh-discussions]: https://github.com/ruby-oauth/oauth2/discussions
282
193
 
283
- If something doesn't work on one of these interpreters, it's a bug.
194
+ ### Enterprise Support [![Tidelift](https://tidelift.com/badges/package/rubygems/oauth2)](https://tidelift.com/subscription/pkg/rubygems-oauth2?utm_source=rubygems-oauth2&utm_medium=referral&utm_campaign=readme)
284
195
 
285
- This library may inadvertently work (or seem to work) on other Ruby
286
- implementations, however support will only be provided for the versions listed
287
- above.
196
+ Available as part of the Tidelift Subscription.
197
+
198
+ <details markdown="1">
199
+ <summary>Need enterprise-level guarantees?</summary>
200
+
201
+ The maintainers of this 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.
202
+
203
+ [![Get help from me on Tidelift][🏙️entsup-tidelift-img]][🏙️entsup-tidelift]
204
+
205
+ - 💡Subscribe for support guarantees covering _all_ your FLOSS dependencies
206
+ - 💡Tidelift is part of [Sonar][🏙️entsup-tidelift-sonar]
207
+ - 💡Tidelift pays maintainers to maintain the software you depend on!<br/>📊`@`Pointy Haired Boss: An [enterprise support][🏙️entsup-tidelift] subscription is "[never gonna let you down][🧮kloc]", and *supports* open source maintainers
208
+
209
+ Alternatively:
210
+
211
+ - [![Live Chat on Discord][✉️discord-invite-img-ftb]][✉️discord-invite]
212
+ - [![Get help from me on Upwork][👨🏼‍🏫expsup-upwork-img]][👨🏼‍🏫expsup-upwork]
213
+ - [![Get help from me on Codementor][👨🏼‍🏫expsup-codementor-img]][👨🏼‍🏫expsup-codementor]
288
214
 
289
- If you would like this library to support another Ruby version, you may
290
- volunteer to be a maintainer. Being a maintainer entails making sure all tests
291
- run and pass on that implementation. When something breaks on your
292
- implementation, you will be responsible for providing patches in a timely
293
- fashion. If critical issues for a particular implementation exist at the time
294
- of a major release, support for that Ruby version may be dropped.
295
215
  </details>
296
216
 
297
- | | Ruby OAuth2 Version | Maintenance Branch | Supported Officially | Supported Unofficially | Supported Incidentally |
298
- |:----|---------------------|--------------------|-------------------------|------------------------|------------------------|
299
- | 1️⃣ | 2.0.x | `main` | 2.7, 3.0, 3.1 | 2.5, 2.6 | 2.2, 2.3, 2.4 |
300
- | 2️⃣ | 1.4.x | `1-4-stable` | 2.5, 2.6, 2.7, 3.0, 3.1 | 2.1, 2.2, 2.3, 2.4 | 1.9, 2.0 |
301
- | 3️⃣ | older | N/A | Best of luck to you! | Please upgrade! | |
217
+ ## Installation
302
218
 
303
- NOTE: The 1.4 series will only receive critical security updates.
304
- See [SECURITY.md][🚎sec-pol]
219
+ Install the gem and add to the application's Gemfile by executing:
305
220
 
306
- ## Usage Examples
221
+ ```console
222
+ bundle add oauth2
223
+ ```
307
224
 
308
- ### Global Configuration
225
+ If bundler is not being used to manage dependencies, install the gem by executing:
309
226
 
310
- If you started seeing this warning, but everything it working fine, you can now silence it.
311
- ```log
312
- OAuth2::AccessToken.from_hash: `hash` contained more than one 'token' key
227
+ ```console
228
+ gem install oauth2
313
229
  ```
314
230
 
231
+ ## ⚙️ Configuration
232
+
233
+ Global settings for the library:
234
+
315
235
  ```ruby
316
236
  OAuth2.configure do |config|
317
- config.silence_extra_tokens_warning = true # default: false
237
+ config.silence_extra_tokens_warning = false # default: true
238
+ config.silence_no_tokens_warning = false # default: true
318
239
  end
319
240
  ```
320
241
 
242
+ Filtering-related settings:
243
+
244
+ ```ruby
245
+ OAuth2.configure do |config|
246
+ config.filtered_label = "[REDACTED]" # default: "[FILTERED]"
247
+ config.filtered_debug_keys += ["client_assertion"]
248
+ end
249
+ ```
250
+
251
+ - `filtered_label` controls the placeholder used when sensitive values are filtered from inspected objects and debug logging output.
252
+ - `filtered_debug_keys` controls which key names have their values redacted from debug logging output when `OAUTH_DEBUG=true`.
253
+ - Debug logging remains opt-in and should still be used cautiously in production environments.
254
+
255
+ ## 🔧 Basic Usage
256
+
257
+ ### Client Initialization Options
258
+
259
+ `OAuth2::Client.new` accepts several options:
260
+
261
+ - `:site`: The base URL for the OAuth 2.0 provider.
262
+ - `:authorize_url`: The authorization endpoint (default: `"oauth/authorize"`).
263
+ - `:token_url`: The token endpoint (default: `"oauth/token"`).
264
+ - `:auth_scheme`: The authentication scheme (`:basic_auth`, `:request_body`, `:tls_client_auth`, `:private_key_jwt`). Default is `:basic_auth`.
265
+ - `:connection_opts`: Options for the underlying Faraday connection (timeouts, proxy, etc.).
266
+ - `:raise_errors`: Whether to raise `OAuth2::Error` on 400+ responses (default: `true`).
267
+
268
+ <details markdown="1">
269
+ <summary><em>authorize_url</em> and <em>token_url</em></summary>
270
+
321
271
  ### `authorize_url` and `token_url` are on site root (Just Works!)
322
272
 
323
273
  ```ruby
324
- require 'oauth2'
325
- client = OAuth2::Client.new('client_id', 'client_secret', site: 'https://example.org')
274
+ require "oauth2"
275
+ client = OAuth2::Client.new("client_id", "client_secret", site: "https://example.org")
326
276
  # => #<OAuth2::Client:0x00000001204c8288 @id="client_id", @secret="client_sec...
327
- client.auth_code.authorize_url(redirect_uri: 'http://localhost:8080/oauth2/callback')
277
+ client.auth_code.authorize_url(redirect_uri: "http://localhost:8080/oauth2/callback")
328
278
  # => "https://example.org/oauth/authorize?client_id=client_id&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Foauth2%2Fcallback&response_type=code"
329
279
 
330
- access = client.auth_code.get_token('authorization_code_value', redirect_uri: 'http://localhost:8080/oauth2/callback', headers: {'Authorization' => 'Basic some_password'})
331
- response = access.get('/api/resource', params: {'query_foo' => 'bar'})
280
+ access = client.auth_code.get_token("authorization_code_value", redirect_uri: "http://localhost:8080/oauth2/callback", headers: {"Authorization" => "Basic some_password"})
281
+ response = access.get("/api/resource", params: {"query_foo" => "bar"})
332
282
  response.class.name
333
283
  # => OAuth2::Response
334
284
  ```
335
285
 
336
286
  ### Relative `authorize_url` and `token_url` (Not on site root, Just Works!)
337
287
 
338
- In above example, the default Authorization URL is `oauth/authorize` and default Access Token URL is `oauth/token`, and, as they are missing a leading `/`, both are relative.
288
+ In the above example, the default Authorization URL is `oauth/authorize` and default Access Token URL is `oauth/token`, and, as they are missing a leading `/`, both are relative.
339
289
 
340
290
  ```ruby
341
- client = OAuth2::Client.new('client_id', 'client_secret', site: 'https://example.org/nested/directory/on/your/server')
291
+ client = OAuth2::Client.new("client_id", "client_secret", site: "https://example.org/nested/directory/on/your/server")
342
292
  # => #<OAuth2::Client:0x00000001204c8288 @id="client_id", @secret="client_sec...
343
- client.auth_code.authorize_url(redirect_uri: 'http://localhost:8080/oauth2/callback')
293
+ client.auth_code.authorize_url(redirect_uri: "http://localhost:8080/oauth2/callback")
344
294
  # => "https://example.org/nested/directory/on/your/server/oauth/authorize?client_id=client_id&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Foauth2%2Fcallback&response_type=code"
345
295
  ```
346
296
 
@@ -349,21 +299,43 @@ client.auth_code.authorize_url(redirect_uri: 'http://localhost:8080/oauth2/callb
349
299
  You can specify custom URLs for authorization and access token, and when using a leading `/` they will _not be relative_, as shown below:
350
300
 
351
301
  ```ruby
352
- client = OAuth2::Client.new('client_id', 'client_secret',
353
- site: 'https://example.org/nested/directory/on/your/server',
354
- authorize_url: '/jaunty/authorize/',
355
- token_url: '/stirrups/access_token')
302
+ client = OAuth2::Client.new(
303
+ "client_id",
304
+ "client_secret",
305
+ site: "https://example.org/nested/directory/on/your/server",
306
+ authorize_url: "/jaunty/authorize/",
307
+ token_url: "/stirrups/access_token"
308
+ )
356
309
  # => #<OAuth2::Client:0x00000001204c8288 @id="client_id", @secret="client_sec...
357
- client.auth_code.authorize_url(redirect_uri: 'http://localhost:8080/oauth2/callback')
310
+ client.auth_code.authorize_url(redirect_uri: "http://localhost:8080/oauth2/callback")
358
311
  # => "https://example.org/jaunty/authorize/?client_id=client_id&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Foauth2%2Fcallback&response_type=code"
359
312
  client.class.name
360
313
  # => OAuth2::Client
361
314
  ```
362
315
 
316
+ </details>
317
+
318
+ ### Advanced Initializers
319
+
320
+ ```ruby
321
+ client = OAuth2::Client.new(id, secret, site: site) do |faraday|
322
+ faraday.request(:url_encoded)
323
+ faraday.adapter(:net_http_persistent)
324
+ end
325
+ ```
326
+
327
+ ### AccessToken Features
328
+
329
+ Instances of `OAuth2::AccessToken` handle request signing and token expiration.
330
+
331
+ - **Snake Case & Indifferent Access**: `response.parsed` returns a `SnakyHash` allowing access via string/symbol and snake_case keys even if the provider returns CamelCase.
332
+ - **Auto-Refresh**: You can manually check `token.expired?` and call `token.refresh`.
333
+ - **Serialization**: Persist tokens using `token.to_hash` and restore via `OAuth2::AccessToken.from_hash(client, hash)`.
334
+
363
335
  ### snake_case and indifferent access in Response#parsed
364
336
 
365
337
  ```ruby
366
- response = access.get('/api/resource', params: {'query_foo' => 'bar'})
338
+ response = access.get("/api/resource", params: {"query_foo" => "bar"})
367
339
  # Even if the actual response is CamelCase. it will be made available as snaky:
368
340
  JSON.parse(response.body) # => {"accessToken"=>"aaaaaaaa", "additionalData"=>"additional"}
369
341
  response.parsed # => {"access_token"=>"aaaaaaaa", "additional_data"=>"additional"}
@@ -371,65 +343,203 @@ response.parsed.access_token # => "aaaaaaaa"
371
343
  response.parsed[:access_token] # => "aaaaaaaa"
372
344
  response.parsed.additional_data # => "additional"
373
345
  response.parsed[:additional_data] # => "additional"
374
- response.parsed.class.name # => OAuth2::SnakyHash (subclass of Hashie::Mash::Rash, from `rash_alt` gem)
346
+ response.parsed.class.name # => SnakyHash::StringKeyed (from snaky_hash gem)
347
+ ```
348
+
349
+ #### Serialization
350
+
351
+ As of v2.0.11, if you need to serialize the parsed result, you can!
352
+
353
+ There are two ways to do this, globally, or discretely. The discrete way is recommended.
354
+
355
+ ##### Global Serialization Config
356
+
357
+ Globally configure `SnakyHash::StringKeyed` to use the serializer. Put this in your code somewhere reasonable (like an initializer for Rails).
358
+
359
+ ```ruby
360
+ SnakyHash::StringKeyed.class_eval do
361
+ extend SnakyHash::Serializer
362
+ end
375
363
  ```
376
364
 
377
- #### What if I hate snakes and/or indifference?
365
+ ##### Discrete Serialization Config
366
+
367
+ Discretely configure a custom Snaky Hash class to use the serializer.
378
368
 
379
369
  ```ruby
380
- response = access.get('/api/resource', params: {'query_foo' => 'bar'}, snaky: false)
370
+ class MySnakyHash < SnakyHash::StringKeyed
371
+ # Give this hash class `dump` and `load` abilities!
372
+ extend SnakyHash::Serializer
373
+ end
374
+
375
+ # And tell your client to use the custom class in each call:
376
+ client = OAuth2::Client.new("client_id", "client_secret", site: "https://example.org/oauth2")
377
+ token = client.get_token({snaky_hash_klass: MySnakyHash})
378
+ ```
379
+
380
+ ##### Serialization Extensions
381
+
382
+ These extensions work regardless of whether you used the global or discrete config above.
383
+
384
+ There are a few hacks you may need in your class to support Ruby < 2.4.2 or < 2.6.
385
+ They are likely not needed if you are on a newer Ruby.
386
+ Expand the examples below, or the [ruby-oauth/snaky_hash](https://gitlab.com/ruby-oauth/snaky_hash) gem,
387
+ or [response_spec.rb](https://github.com/ruby-oauth/oauth2/blob/main/spec/oauth2/response_spec.rb), for more ideas, especially if you need to study the hacks for older Rubies.
388
+
389
+ <details markdown="1">
390
+ <summary>See Examples</summary>
391
+
392
+ ```ruby
393
+ class MySnakyHash < SnakyHash::StringKeyed
394
+ # Give this hash class `dump` and `load` abilities!
395
+ extend SnakyHash::Serializer
396
+
397
+ #### Serialization Extentions
398
+ #
399
+ # Act on the non-hash values (including the values of hashes) as they are dumped to JSON
400
+ # In other words, this retains nested hashes, and only the deepest leaf nodes become bananas.
401
+ # WARNING: This is a silly example!
402
+ dump_value_extensions.add(:to_fruit) do |value|
403
+ "banana" # => Make values "banana" on dump
404
+ end
405
+
406
+ # Act on the non-hash values (including the values of hashes) as they are loaded from the JSON dump
407
+ # In other words, this retains nested hashes, and only the deepest leaf nodes become ***.
408
+ # WARNING: This is a silly example!
409
+ load_value_extensions.add(:to_stars) do |value|
410
+ "***" # Turn dumped bananas into *** when they are loaded
411
+ end
412
+
413
+ # Act on the entire hash as it is prepared for dumping to JSON
414
+ # WARNING: This is a silly example!
415
+ dump_hash_extensions.add(:to_cheese) do |value|
416
+ if value.is_a?(Hash)
417
+ value.transform_keys do |key|
418
+ split = key.split("_")
419
+ first_word = split[0]
420
+ key.sub(first_word, "cheese")
421
+ end
422
+ else
423
+ value
424
+ end
425
+ end
426
+
427
+ # Act on the entire hash as it is loaded from the JSON dump
428
+ # WARNING: This is a silly example!
429
+ load_hash_extensions.add(:to_pizza) do |value|
430
+ if value.is_a?(Hash)
431
+ res = klass.new
432
+ value.keys.each_with_object(res) do |key, result|
433
+ split = key.split("_")
434
+ last_word = split[-1]
435
+ new_key = key.sub(last_word, "pizza")
436
+ result[new_key] = value[key]
437
+ end
438
+ res
439
+ else
440
+ value
441
+ end
442
+ end
443
+ end
444
+ ```
445
+
446
+ </details>
447
+
448
+ #### Prefer camelCase over snake_case? => snaky: false
449
+
450
+ ```ruby
451
+ response = access.get("/api/resource", params: {"query_foo" => "bar"}, snaky: false)
381
452
  JSON.parse(response.body) # => {"accessToken"=>"aaaaaaaa", "additionalData"=>"additional"}
382
453
  response.parsed # => {"accessToken"=>"aaaaaaaa", "additionalData"=>"additional"}
383
- response.parsed['accessToken'] # => "aaaaaaaa"
384
- response.parsed['additionalData'] # => "additional"
454
+ response.parsed["accessToken"] # => "aaaaaaaa"
455
+ response.parsed["additionalData"] # => "additional"
385
456
  response.parsed.class.name # => Hash (just, regular old Hash)
386
457
  ```
387
458
 
388
- <details>
389
- <summary>Debugging</summary>
459
+ <details markdown="1">
460
+ <summary>Debugging & Logging</summary>
390
461
 
391
- Set an environment variable, however you would [normally do that](https://github.com/bkeepers/dotenv).
462
+ Set an environment variable as per usual (e.g. with [dotenv](https://github.com/bkeepers/dotenv)).
392
463
 
393
464
  ```ruby
394
465
  # will log both request and response, including bodies
395
- ENV['OAUTH_DEBUG'] = 'true'
466
+ ENV["OAUTH_DEBUG"] = "true"
396
467
  ```
397
468
 
398
469
  By default, debug output will go to `$stdout`. This can be overridden when
399
470
  initializing your OAuth2::Client.
400
471
 
472
+ Sensitive values are filtered from debug logging output using:
473
+
474
+ - `OAuth2.config[:filtered_label]`
475
+ - `OAuth2.config[:filtered_debug_keys]`
476
+
477
+ Debug logging remains opt-in and should still be used cautiously in production environments.
478
+
401
479
  ```ruby
402
- require 'oauth2'
480
+ require "oauth2"
403
481
  client = OAuth2::Client.new(
404
- 'client_id',
405
- 'client_secret',
406
- site: 'https://example.org',
407
- logger: Logger.new('example.log', 'weekly')
482
+ "client_id",
483
+ "client_secret",
484
+ site: "https://example.org",
485
+ logger: Logger.new("example.log", "weekly")
408
486
  )
409
487
  ```
488
+
410
489
  </details>
411
490
 
412
- ## OAuth2::Response
491
+ ### Request Target Trust Boundaries
492
+
493
+ This gem supports request flows that can involve absolute URLs in addition to relative paths.
494
+ That flexibility can expand trust boundaries when a token-bearing client is asked to send requests
495
+ to caller-provided targets.
496
+
497
+ Practical guidance:
498
+
499
+ - prefer relative paths where practical
500
+ - do not pass untrusted absolute URLs into token-bearing clients
501
+ - validate or allowlist request targets at the application layer today if your deployment has strict trust-boundary requirements
502
+
503
+ This release line does not yet enforce same-host or allowlist request policy automatically.
504
+ If stricter outbound request controls are needed, they should currently be implemented by the calling application.
505
+
506
+ ### OAuth2::Response
413
507
 
414
508
  The `AccessToken` methods `#get`, `#post`, `#put` and `#delete` and the generic `#request`
415
- will return an instance of the #OAuth2::Response class.
509
+ will return an instance of the `OAuth2::Response` class.
416
510
 
417
511
  This instance contains a `#parsed` method that will parse the response body and
418
- return a Hash-like [`OAuth2::SnakyHash`](https://gitlab.com/oauth-xx/oauth2/-/blob/main/lib/oauth2/snaky_hash.rb) if the `Content-Type` is `application/x-www-form-urlencoded` or if
419
- the body is a JSON object. It will return an Array if the body is a JSON
420
- array. Otherwise, it will return the original body string.
512
+ return a Hash-like [`SnakyHash::StringKeyed`](https://gitlab.com/ruby-oauth/snaky_hash/-/blob/main/lib/snaky_hash/string_keyed.rb) if the `Content-Type` is `application/x-www-form-urlencoded` or if
513
+ the body is a JSON object. It will return an Array if the body is a JSON
514
+ array. Otherwise, it will return the original body string.
421
515
 
422
516
  The original response body, headers, and status can be accessed via their
423
517
  respective methods.
424
518
 
425
- ## OAuth2::AccessToken
519
+ ### OAuth2::AccessToken
426
520
 
427
521
  If you have an existing Access Token for a user, you can initialize an instance
428
522
  using various class methods including the standard new, `from_hash` (if you have
429
523
  a hash of the values), or `from_kvform` (if you have an
430
524
  `application/x-www-form-urlencoded` encoded string of the values).
431
525
 
432
- ## OAuth2::Error
526
+ Options (since v2.0.x unless noted):
527
+
528
+ - `expires_latency` (Integer | nil): Seconds to subtract from expires_in when computing #expired? to offset latency.
529
+ - `token_name` (String | Symbol | nil): When multiple token-like fields exist in responses, select the field name to use as the access token (since v2.0.10).
530
+ - `mode` (Symbol | Proc | Hash): Controls how the token is transmitted on requests made via this AccessToken instance.
531
+ - `:header` — Send as Authorization: Bearer <token> header (default and preferred by OAuth 2.1 draft guidance).
532
+ - `:query` — Send as access_token query parameter (discouraged in general, but required by some providers).
533
+ - Verb-dependent (since v2.0.15): Provide either:
534
+ - a `Proc` taking `|verb|` and returning `:header` or `:query`, or
535
+ - a `Hash` with verb symbols as keys, for example `{get: :query, post: :header, delete: :header}`.
536
+
537
+ Note: Verb-dependent mode supports providers like Instagram that require query mode for `GET` and header mode for `POST`/`DELETE`
538
+
539
+ - Verb-dependent mode via `Proc` was added in v2.0.15
540
+ - Verb-dependent mode via `Hash` was added in v2.0.16
541
+
542
+ ### OAuth2::Error
433
543
 
434
544
  On 400+ status code responses, an `OAuth2::Error` will be raised. If it is a
435
545
  standard OAuth2 error response, the body will be parsed and `#code` and `#description` will contain the values provided from the error and
@@ -441,108 +551,570 @@ option on initialization of the client. In this case the `OAuth2::Response`
441
551
  instance will be returned as usual and on 400+ status code responses, the
442
552
  Response instance will contain the `OAuth2::Error` instance.
443
553
 
444
- ## Authorization Grants
554
+ ### Authorization Grants
445
555
 
446
- Currently the Authorization Code, Implicit, Resource Owner Password Credentials, Client Credentials, and Assertion
556
+ Currently, the Authorization Code, Implicit, Resource Owner Password Credentials, Client Credentials, and Assertion
447
557
  authentication grant types have helper strategy classes that simplify client
448
- use. They are available via the [`#auth_code`](https://gitlab.com/oauth-xx/oauth2/-/blob/main/lib/oauth2/strategy/auth_code.rb),
449
- [`#implicit`](https://gitlab.com/oauth-xx/oauth2/-/blob/main/lib/oauth2/strategy/implicit.rb),
450
- [`#password`](https://gitlab.com/oauth-xx/oauth2/-/blob/main/lib/oauth2/strategy/password.rb),
451
- [`#client_credentials`](https://gitlab.com/oauth-xx/oauth2/-/blob/main/lib/oauth2/strategy/client_credentials.rb), and
452
- [`#assertion`](https://gitlab.com/oauth-xx/oauth2/-/blob/main/lib/oauth2/strategy/assertion.rb) methods respectively.
558
+ use. They are available via the [`#auth_code`](https://gitlab.com/ruby-oauth/oauth2/-/blob/main/lib/oauth2/strategy/auth_code.rb),
559
+ [`#implicit`](https://gitlab.com/ruby-oauth/oauth2/-/blob/main/lib/oauth2/strategy/implicit.rb),
560
+ [`#password`](https://gitlab.com/ruby-oauth/oauth2/-/blob/main/lib/oauth2/strategy/password.rb),
561
+ [`#client_credentials`](https://gitlab.com/ruby-oauth/oauth2/-/blob/main/lib/oauth2/strategy/client_credentials.rb), and
562
+ [`#assertion`](https://gitlab.com/ruby-oauth/oauth2/-/blob/main/lib/oauth2/strategy/assertion.rb) methods respectively.
563
+
564
+ #### OAuth 2.1 (draft) Note:
565
+
566
+ - **PKCE** is required for all OAuth clients using the authorization code flow (especially public clients). Implement PKCE in your app when required by your provider. See RFC 7636 and RFC 8252.
567
+ - **Implicit grant** (response_type=token) and **Resource Owner Password Credentials grant** are omitted from OAuth 2.1; they remain here for OAuth 2.0 compatibility but should be avoided for new apps.
568
+ - **Redirect URIs** must be compared using exact string matching by the Authorization Server.
569
+
570
+ <details markdown="1">
571
+ <summary>OAuth 2.1 (draft) References</summary>
572
+
573
+ - OAuth 2.1 draft: https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-13
574
+ - Aaron Parecki: https://aaronparecki.com/2019/12/12/21/its-time-for-oauth-2-dot-1
575
+ - FusionAuth: https://fusionauth.io/blog/2020/04/15/whats-new-in-oauth-2-1
576
+ - Okta: https://developer.okta.com/blog/2019/12/13/oauth-2-1-how-many-rfcs
577
+ - Video: https://www.youtube.com/watch?v=g_aVPdwBTfw
578
+ - Differences overview: https://fusionauth.io/learn/expert-advice/oauth/differences-between-oauth-2-oauth-2-1/
579
+
580
+ </details>
453
581
 
454
582
  These aren't full examples, but demonstrative of the differences between usage for each strategy.
583
+
455
584
  ```ruby
456
- auth_url = client.auth_code.authorize_url(redirect_uri: 'http://localhost:8080/oauth/callback')
457
- access = client.auth_code.get_token('code_value', redirect_uri: 'http://localhost:8080/oauth/callback')
585
+ auth_url = client.auth_code.authorize_url(redirect_uri: "http://localhost:8080/oauth/callback")
586
+ access = client.auth_code.get_token("code_value", redirect_uri: "http://localhost:8080/oauth/callback")
458
587
 
459
- auth_url = client.implicit.authorize_url(redirect_uri: 'http://localhost:8080/oauth/callback')
588
+ auth_url = client.implicit.authorize_url(redirect_uri: "http://localhost:8080/oauth/callback")
460
589
  # get the token params in the callback and
461
590
  access = OAuth2::AccessToken.from_kvform(client, query_string)
462
591
 
463
- access = client.password.get_token('username', 'password')
592
+ access = client.password.get_token("username", "password")
464
593
 
465
594
  access = client.client_credentials.get_token
466
595
 
467
596
  # Client Assertion Strategy
468
597
  # see: https://tools.ietf.org/html/rfc7523
469
598
  claimset = {
470
- iss: 'http://localhost:3001',
471
- aud: 'http://localhost:8080/oauth2/token',
472
- sub: 'me@example.com',
599
+ iss: "http://localhost:3001",
600
+ aud: "http://localhost:8080/oauth2/token",
601
+ sub: "me@example.com",
473
602
  exp: Time.now.utc.to_i + 3600,
474
603
  }
475
- assertion_params = [claimset, 'HS256', 'secret_key']
604
+ assertion_params = [claimset, "HS256", "secret_key"]
476
605
  access = client.assertion.get_token(assertion_params)
477
606
 
478
607
  # The `access` (i.e. access token) is then used like so:
479
608
  access.token # actual access_token string, if you need it somewhere
480
- access.get('/api/stuff') # making api calls with access token
609
+ access.get("/api/stuff") # making api calls with access token
481
610
  ```
482
611
 
483
612
  If you want to specify additional headers to be sent out with the
484
613
  request, add a 'headers' hash under 'params':
485
614
 
486
615
  ```ruby
487
- access = client.auth_code.get_token('code_value', redirect_uri: 'http://localhost:8080/oauth/callback', headers: {'Some' => 'Header'})
616
+ access = client.auth_code.get_token("code_value", redirect_uri: "http://localhost:8080/oauth/callback", headers: {"Some" => "Header"})
488
617
  ```
489
618
 
490
619
  You can always use the `#request` method on the `OAuth2::Client` instance to make
491
620
  requests for tokens for any Authentication grant type.
492
621
 
493
- ## Versioning
622
+ ## 🦷 FLOSS Funding
623
+
624
+ While ruby-oauth tools are free software and will always be, the project would benefit immensely from some funding.
625
+ Raising a monthly budget of... "dollars" would make the project more sustainable.
626
+
627
+ We welcome both individual and corporate sponsors! We also offer a
628
+ wide array of funding channels to account for your preferences.
629
+ Currently, [Open Collective][🖇osc] is our preferred funding platform.
630
+
631
+ **If you're working in a company that's making significant use of ruby-oauth tools we'd
632
+ appreciate it if you suggest to your company to become a ruby-oauth sponsor.**
633
+
634
+ You can support the development of ruby-oauth tools via
635
+ [GitHub Sponsors][🖇sponsor],
636
+ [Liberapay][⛳liberapay],
637
+ [PayPal][🖇paypal],
638
+ [Open Collective][🖇osc]
639
+ and [Tidelift][🏙️entsup-tidelift].
640
+
641
+ | 📍 NOTE |
642
+ |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
643
+ | If doing a sponsorship in the form of donation is problematic for your company <br/> from an accounting standpoint, we'd recommend the use of Tidelift, <br/> where you can get a support-like subscription instead. |
644
+
645
+ ### Open Collective for Individuals
646
+
647
+ Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/ruby-oauth#backer)]
648
+
649
+ NOTE: [kettle-readme-backers][kettle-readme-backers] updates this list every day, automatically.
650
+
651
+ <!-- OPENCOLLECTIVE-INDIVIDUALS:START -->
652
+ No backers yet. Be the first!
653
+ <!-- OPENCOLLECTIVE-INDIVIDUALS:END -->
654
+
655
+ ### Open Collective for Organizations
494
656
 
495
- This library aims to adhere to [Semantic Versioning 2.0.0][semver].
496
- Violations of this scheme should be reported as bugs. Specifically,
497
- if a minor or patch version is released that breaks backward
498
- compatibility, a new version should be immediately released that
499
- restores compatibility. Breaking changes to the public API will
500
- only be introduced with new major versions.
657
+ Become a sponsor and get your logo on our README on GitHub with a link to your site. [[Become a sponsor](https://opencollective.com/ruby-oauth#sponsor)]
501
658
 
502
- As a result of this policy, you can (and should) specify a
503
- dependency on this gem using the [Pessimistic Version Constraint][pvc] with two digits of precision.
659
+ NOTE: [kettle-readme-backers][kettle-readme-backers] updates this list every day, automatically.
660
+
661
+ <!-- OPENCOLLECTIVE-ORGANIZATIONS:START -->
662
+ No sponsors yet. Be the first!
663
+ <!-- OPENCOLLECTIVE-ORGANIZATIONS:END -->
664
+
665
+ [kettle-readme-backers]: https://github.com/ruby-oauth/oauth2/blob/main/exe/kettle-readme-backers
666
+
667
+ ### Another way to support open-source
668
+
669
+ I’m driven by a passion to foster a thriving open-source community – a space where people can tackle complex problems, no matter how small. Revitalizing libraries that have fallen into disrepair, and building new libraries focused on solving real-world challenges, are my passions. I was recently affected by layoffs, and the tech jobs market is unwelcoming. I’m reaching out here because your support would significantly aid my efforts to provide for my family, and my farm (11 🐔 chickens, 2 🐶 dogs, 3 🐰 rabbits, 8 🐈‍ cats).
670
+
671
+ If you work at a company that uses my work, please encourage them to support me as a corporate sponsor. My work on gems you use might show up in `bundle fund`.
672
+
673
+ I’m developing a new library, [floss_funding][🖇floss-funding-gem], designed to empower open-source developers like myself to get paid for the work we do, in a sustainable way. Please give it a look.
674
+
675
+ **[Floss-Funding.dev][🖇floss-funding.dev]: 👉️ No network calls. 👉️ No tracking. 👉️ No oversight. 👉️ Minimal crypto hashing. 💡 Easily disabled nags**
676
+
677
+ [![OpenCollective Backers][🖇osc-backers-i]][🖇osc-backers] [![OpenCollective Sponsors][🖇osc-sponsors-i]][🖇osc-sponsors] [![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor] [![Liberapay Goal Progress][⛳liberapay-img]][⛳liberapay] [![Donate on PayPal][🖇paypal-img]][🖇paypal] [![Buy me a coffee][🖇buyme-small-img]][🖇buyme] [![Donate on Polar][🖇polar-img]][🖇polar] [![Donate to my FLOSS efforts at ko-fi.com][🖇kofi-img]][🖇kofi] [![Donate to my FLOSS efforts using Patreon][🖇patreon-img]][🖇patreon]
678
+
679
+ ## 🔐 Security
680
+
681
+ See [SECURITY.md][🔐security].
682
+
683
+ ## 🤝 Contributing
684
+
685
+ If you need some ideas of where to help, you could work on adding more code coverage,
686
+ or if it is already 💯 (see [below](#code-coverage)) check [issues][🤝gh-issues] or [PRs][🤝gh-pulls],
687
+ or use the gem and think about how it could be better.
688
+
689
+ We [![Keep A Changelog][📗keep-changelog-img]][📗keep-changelog] so if you make changes, remember to update it.
690
+
691
+ See [CONTRIBUTING.md][🤝contributing] for more detailed instructions.
692
+
693
+ ### 🚀 Release Instructions
694
+
695
+ See [CONTRIBUTING.md][🤝contributing].
696
+
697
+ ### Code Coverage
698
+
699
+ <details markdown="1">
700
+ <summary>Coverage service badges</summary>
701
+
702
+ [![Coverage Graph][🏀codecov-g]][🏀codecov]
703
+
704
+ [![Coveralls Test Coverage][🏀coveralls-img]][🏀coveralls]
705
+
706
+ [![QLTY Test Coverage][🏀qlty-covi]][🏀qlty-cov]
707
+
708
+ </details>
709
+
710
+ ### 🪇 Code of Conduct
711
+
712
+ Everyone interacting with this project's codebases, issue trackers,
713
+ chat rooms and mailing lists agrees to follow the [![Contributor Covenant 2.1][🪇conduct-img]][🪇conduct].
714
+
715
+ ## 🌈 Contributors
716
+
717
+ [![Contributors][🖐contributors-img]][🖐contributors]
718
+
719
+ Made with [contributors-img][🖐contrib-rocks].
720
+
721
+ Also see GitLab Contributors: [https://gitlab.com/ruby-oauth/oauth2/-/graphs/main][🚎contributors-gl]
722
+
723
+ <details>
724
+ <summary>⭐️ Star History</summary>
725
+
726
+ <a href="https://star-history.com/ruby-oauth/oauth2&Date">
727
+ <picture>
728
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=ruby-oauth/oauth2&type=Date&theme=dark" />
729
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=ruby-oauth/oauth2&type=Date" />
730
+ <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=ruby-oauth/oauth2&type=Date" />
731
+ </picture>
732
+ </a>
733
+
734
+ </details>
735
+
736
+ ## 📌 Versioning
737
+
738
+ This library follows [![Semantic Versioning 2.0.0][📌semver-img]][📌semver] for its public API where practical.
739
+ For most applications, prefer the [Pessimistic Version Constraint][📌pvc] with two digits of precision.
504
740
 
505
741
  For example:
506
742
 
507
743
  ```ruby
508
- spec.add_dependency 'oauth2', '~> 2.0'
744
+ spec.add_dependency("oauth2", "~> 2.0")
509
745
  ```
510
746
 
511
- [semver]: http://semver.org/
512
- [pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
747
+ <details markdown="1">
748
+ <summary>📌 Is "Platform Support" part of the public API? More details inside.</summary>
513
749
 
514
- ## License
750
+ Dropping support for a platform can be a breaking change for affected users.
751
+ If a release changes supported platforms, it should be called out clearly in the changelog and versioned with that impact in mind.
515
752
 
516
- [![License: MIT][🖇src-license-img]][🖇src-license]
753
+ To get a better understanding of how SemVer is intended to work over a project's lifetime,
754
+ read this article from the creator of SemVer:
517
755
 
518
- - Copyright (c) 2011-2013 Michael Bleigh and Intridea, Inc.
519
- - Copyright (c) 2017-2022 [oauth-xx organization][oauth-xx]
520
- - See [LICENSE][license] for details.
756
+ - ["Major Version Numbers are Not Sacred"][📌major-versions-not-sacred]
521
757
 
522
- [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Foauth-xx%2Foauth2.svg?type=large)][fossa2]
758
+ </details>
523
759
 
524
- [license]: https://gitlab.com/oauth-xx/oauth2/-/blob/main/LICENSE
525
- [oauth-xx]: https://gitlab.com/oauth-xx
526
- [fossa2]: https://app.fossa.io/projects/git%2Bgithub.com%2Foauth-xx%2Foauth2?ref=badge_large
760
+ See [CHANGELOG.md][📌changelog] for a list of releases.
761
+
762
+ ## 📄 License
763
+
764
+ The gem is available as open source under the terms of
765
+ the [MIT](MIT.md) [![License: MIT][📄license-img]][📄license-ref].
766
+
767
+ ### © Copyright
768
+
769
+ See [LICENSE.md][📄license] for the official copyright notice.
770
+
771
+ <details markdown="1">
772
+ <summary>Copyright holders</summary>
773
+
774
+ - Copyright (c) 2010-2014, 2016-2017 Erik Michaels-Ober
775
+ - Copyright (c) 2010 Jeremy Kemper
776
+ - Copyright (c) 2010-2011 Michael Bleigh
777
+ - Copyright (c) 2010-2011 Paul Walker
778
+ - Copyright (c) 2010 rick
779
+ - Copyright (c) 2010 Tim Habermaas
780
+ - Copyright (c) 2010 Wynn Netherland
781
+ - Copyright (c) 2011 Alexander Lang
782
+ - Copyright (c) 2011 Alexander Lang
783
+ - Copyright (c) 2011 Greg Spurrier
784
+ - Copyright (c) 2011 Jay Adkisson
785
+ - Copyright (c) 2011 Luke Saunders
786
+ - Copyright (c) 2011 Paul Walker
787
+ - Copyright (c) 2011 Simon Gate
788
+ - Copyright (c) 2012 Bas Vodde
789
+ - Copyright (c) 2012 Damian Janowski
790
+ - Copyright (c) 2012 Daniël van de Burgt
791
+ - Copyright (c) 2012 Dorren Chen
792
+ - Copyright (c) 2012 Igor Sales
793
+ - Copyright (c) 2012 Leigh Caplan
794
+ - Copyright (c) 2012 Michael Andrews
795
+ - Copyright (c) 2012 Omer Rauchwerger
796
+ - Copyright (c) 2012 Saverio Trioni
797
+ - Copyright (c) 2012 Trent Ogren
798
+ - Copyright (c) 2012 Vsevolod Romashov
799
+ - Copyright (c) 2013 Antonio Tapiador del Dujo
800
+ - Copyright (c) 2013 Eduardo Gurgel
801
+ - Copyright (c) 2013 Geostellar Developer
802
+ - Copyright (c) 2013-2014, 2018 Niels Ganser
803
+ - Copyright (c) 2013 Rainux Luo
804
+ - Copyright (c) 2013 Taylor Hedberg
805
+ - Copyright (c) 2013 Tim Clem
806
+ - Copyright (c) 2014 Dave Stevens
807
+ - Copyright (c) 2014 Ellis Berner
808
+ - Copyright (c) 2014 Frank Macreery
809
+ - Copyright (c) 2014 Michael Bleigh
810
+ - Copyright (c) 2014 Olivier Lacan
811
+ - Copyright (c) 2014 Peter Souter
812
+ - Copyright (c) 2014 Ryan Williams
813
+ - Copyright (c) 2015 Andrew Cantino and Jeff Moore
814
+ - Copyright (c) 2015 Thomas Walpole
815
+ - Copyright (c) 2016 Bo Jeanes
816
+ - Copyright (c) 2016 Cody Cutrer
817
+ - Copyright (c) 2016 Edward Rudd
818
+ - Copyright (c) 2016 Lawrence Oluyede
819
+ - Copyright (c) 2016 Linus Pettersson
820
+ - Copyright (c) 2016 Motoshi Nishihira
821
+ - Copyright (c) 2017 Adrian Setyadi
822
+ - Copyright (c) 2017-2018 Benjamin Quorning
823
+ - Copyright (c) 2017 Christoph Petschnig
824
+ - Copyright (c) 2017, 2022 Nathaniel Bibler
825
+ - Copyright (c) 2017 Oleg
826
+ - Copyright (c) 2017 Samuel Cochran
827
+ - Copyright (c) 2017 tetsuya
828
+ - Copyright (c) 2017 Yury Velikanau
829
+ - Copyright (c) 2018 Alex Kowalczuk
830
+ - Copyright (c) 2018 asm__
831
+ - Copyright (c) 2018 David Christensen
832
+ - Copyright (c) 2018 fossabot
833
+ - Copyright (c) 2018 Jeff Moore
834
+ - Copyright (c) 2018 Jeff Moore
835
+ - Copyright (c) 2018 Jonathan del Strother
836
+ - Copyright (c) 2018 Joseph Page
837
+ - Copyright (c) 2018 Joseph Page
838
+ - Copyright (c) 2018 Lomey
839
+ - Copyright (c) 2018 Markus Bengts
840
+ - Copyright (c) 2018 Mathias Klippinge
841
+ - Copyright (c) 2018 nikz
842
+ - Copyright (c) 2018-2019, 2021-2022, 2024-2026 Peter H. Boling
843
+ - Copyright (c) 2019 Daniel Fockler
844
+ - Copyright (c) 2019 Elliot Crosby-McCullough
845
+ - Copyright (c) 2019 João Paulo
846
+ - Copyright (c) 2019 Orien Madgwick
847
+ - Copyright (c) 2019 Ryan T. Hosford
848
+ - Copyright (c) 2019 Tom Corley
849
+ - Copyright (c) 2020 anvox
850
+ - Copyright (c) 2020 Jesse Cotton
851
+ - Copyright (c) 2020 Olle Jonsson
852
+ - Copyright (c) 2020 Stephen Reid
853
+ - Copyright (c) 2021 Anders Carling
854
+ - Copyright (c) 2021 dobon
855
+ - Copyright (c) 2021 Jan Zaydowicz
856
+ - Copyright (c) 2021 Nicholas Palaniuk
857
+ - Copyright (c) 2021-2022 Stan Hu
858
+ - Copyright (c) 2022 Benjamin Quorning
859
+ - Copyright (c) 2022 Bouke van der Bijl
860
+ - Copyright (c) 2022 nov
861
+ - Copyright (c) 2022 Rick Selby
862
+ - Copyright (c) 2022 Ryo Takahashi
863
+ - Copyright (c) 2023 Jessie Young
864
+ - Copyright (c) 2023 Карим Гимадеев
865
+ - Copyright (c) 2024 Aboling0
866
+ - Copyright (c) 2024 Elise Wood
867
+ - Copyright (c) 2024 Manuel van Rijn
868
+ - Copyright (c) 2025-2026 Annibelle Boling
869
+ - Copyright (c) 2025 Mark James
870
+ - Copyright (c) 2025 Mridang Agarwalla
871
+ - Copyright (c) 2025 Sasa Rosic
872
+ - Copyright (c) 2026 Jonathan Grinstead
873
+ - Copyright (c) 2026 kain
874
+ - Copyright (c) 2026 StepSecurity Bot
527
875
 
528
- ## Development
876
+ </details>
529
877
 
530
- After 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.
878
+ ## 🤑 A request for help
531
879
 
532
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, 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).
880
+ Maintainers have teeth and need to pay their dentists.
881
+ After getting laid off in an RIF in March, and encountering difficulty finding a new one,
882
+ I began spending most of my time building open source tools.
883
+ I'm hoping to be able to pay for my kids' health insurance this month,
884
+ so if you value the work I am doing, I need your support.
885
+ Please consider sponsoring me or the project.
533
886
 
534
- ## Contributing
887
+ To join the community or get help 👇️ Join the Discord.
535
888
 
536
- See [CONTRIBUTING.md][contributing]
889
+ [![Live Chat on Discord][✉️discord-invite-img-ftb]][✉️discord-invite]
537
890
 
538
- [contributing]: https://gitlab.com/oauth-xx/oauth2/-/blob/main/CONTRIBUTING.md
891
+ To say "thanks!" ☝️ Join the Discord or 👇️ send money.
539
892
 
540
- ## Contributors
893
+ [![Sponsor ruby-oauth/oauth2 on Open Source Collective][🖇osc-all-bottom-img]][🖇osc] 💌 [![Sponsor me on GitHub Sponsors][🖇sponsor-bottom-img]][🖇sponsor] 💌 [![Sponsor me on Liberapay][⛳liberapay-bottom-img]][⛳liberapay] 💌 [![Donate on PayPal][🖇paypal-bottom-img]][🖇paypal]
541
894
 
542
- [![Contributors](https://contrib.rocks/image?repo=oauth-xx/oauth2)]("https://gitlab.com/oauth-xx/oauth2/-/graphs/main")
895
+ ### Please give the project a star ⭐ ♥.
543
896
 
544
- Made with [contributors-img](https://contrib.rocks).
897
+ Many parts of this project are actively managed by a [kettle-jem](https://github.com/structuredmerge/structuredmerge-ruby/tree/main/gems/kettle-jem) smart template utilizing [StructuredMerge.org](https://structuredmerge.org) merge contracts.
545
898
 
546
- ## Code of Conduct
899
+ Thanks for RTFM. ☺️
547
900
 
548
- Everyone interacting in the OAuth2 project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://gitlab.com/oauth-xx/oauth2/-/blob/main/CODE_OF_CONDUCT.md).
901
+ [⛳liberapay-img]: https://img.shields.io/liberapay/goal/pboling.svg?logo=liberapay&color=a51611&style=flat
902
+ [⛳liberapay-bottom-img]: https://img.shields.io/liberapay/goal/pboling.svg?style=for-the-badge&logo=liberapay&color=a51611
903
+ [⛳liberapay]: https://liberapay.com/pboling/donate
904
+ [🖇osc-all-img]: https://img.shields.io/opencollective/all/ruby-oauth
905
+ [🖇osc-sponsors-img]: https://img.shields.io/opencollective/sponsors/ruby-oauth
906
+ [🖇osc-backers-img]: https://img.shields.io/opencollective/backers/ruby-oauth
907
+ [🖇osc-backers]: https://opencollective.com/ruby-oauth#backer
908
+ [🖇osc-backers-i]: https://opencollective.com/ruby-oauth/backers/badge.svg?style=flat
909
+ [🖇osc-sponsors]: https://opencollective.com/ruby-oauth#sponsor
910
+ [🖇osc-sponsors-i]: https://opencollective.com/ruby-oauth/sponsors/badge.svg?style=flat
911
+ [🖇osc-all-bottom-img]: https://img.shields.io/opencollective/all/ruby-oauth?style=for-the-badge
912
+ [🖇osc-sponsors-bottom-img]: https://img.shields.io/opencollective/sponsors/ruby-oauth?style=for-the-badge
913
+ [🖇osc-backers-bottom-img]: https://img.shields.io/opencollective/backers/ruby-oauth?style=for-the-badge
914
+ [🖇osc]: https://opencollective.com/ruby-oauth
915
+ [🖇sponsor-img]: https://img.shields.io/badge/Sponsor_Me!-pboling.svg?style=social&logo=github
916
+ [🖇sponsor-bottom-img]: https://img.shields.io/badge/Sponsor_Me!-pboling-blue?style=for-the-badge&logo=github
917
+ [🖇sponsor]: https://github.com/sponsors/pboling
918
+ [🖇polar-img]: https://img.shields.io/badge/polar-donate-a51611.svg?style=flat
919
+ [🖇polar]: https://polar.sh/pboling
920
+ [🖇kofi-img]: https://img.shields.io/badge/ko--fi-%E2%9C%93-a51611.svg?style=flat
921
+ [🖇kofi]: https://ko-fi.com/pboling
922
+ [🖇patreon-img]: https://img.shields.io/badge/patreon-donate-a51611.svg?style=flat
923
+ [🖇patreon]: https://patreon.com/galtzo
924
+ [🖇buyme-small-img]: https://img.shields.io/badge/buy_me_a_coffee-%E2%9C%93-a51611.svg?style=flat
925
+ [🖇buyme-img]: https://img.buymeacoffee.com/button-api/?text=Buy%20me%20a%20latte&emoji=&slug=pboling&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff
926
+ [🖇buyme]: https://www.buymeacoffee.com/pboling
927
+ [🖇paypal-img]: https://img.shields.io/badge/donate-paypal-a51611.svg?style=flat&logo=paypal
928
+ [🖇paypal-bottom-img]: https://img.shields.io/badge/donate-paypal-a51611.svg?style=for-the-badge&logo=paypal&color=0A0A0A
929
+ [🖇paypal]: https://www.paypal.com/paypalme/peterboling
930
+ [🖇floss-funding.dev]: https://floss-funding.dev
931
+ [🖇floss-funding-gem]: https://github.com/galtzo-floss/floss_funding
932
+ [✉️discord-invite]: https://discord.gg/3qme4XHNKN
933
+ [✉️discord-invite-img-ftb]: https://img.shields.io/discord/1373797679469170758?style=for-the-badge&logo=discord
934
+ [✉️ruby-friends-img]: https://img.shields.io/badge/daily.dev-%F0%9F%92%8E_Ruby_Friends-0A0A0A?style=for-the-badge&logo=dailydotdev&logoColor=white
935
+ [✉️ruby-friends]: https://app.daily.dev/squads/rubyfriends
936
+
937
+ [✇bundle-group-pattern]: https://gist.github.com/pboling/4564780
938
+ [⛳️gem-namespace]: https://github.com/ruby-oauth/oauth2
939
+ [⛳️namespace-img]: https://img.shields.io/badge/namespace-OAuth2-3C2D2D.svg?style=square&logo=ruby&logoColor=white
940
+ [⛳️gem-name]: https://bestgems.org/gems/oauth2
941
+ [⛳️name-img]: https://img.shields.io/badge/name-oauth2-3C2D2D.svg?style=square&logo=rubygems&logoColor=red
942
+ [⛳️tag-img]: https://img.shields.io/github/tag/ruby-oauth/oauth2.svg
943
+ [⛳️tag]: https://github.com/ruby-oauth/oauth2/releases
944
+ [🚂maint-blog]: http://www.railsbling.com/tags/oauth2
945
+ [🚂maint-blog-img]: https://img.shields.io/badge/blog-railsbling-0093D0.svg?style=for-the-badge&logo=rubyonrails&logoColor=orange
946
+ [🚂maint-contact]: http://www.railsbling.com/contact
947
+ [🚂maint-contact-img]: https://img.shields.io/badge/Contact-Maintainer-0093D0.svg?style=flat&logo=rubyonrails&logoColor=red
948
+ [💖🖇linkedin]: http://www.linkedin.com/in/peterboling
949
+ [💖🖇linkedin-img]: https://img.shields.io/badge/LinkedIn-Profile-0B66C2?style=flat&logo=newjapanprowrestling
950
+ [💖✌️wellfound]: https://wellfound.com/u/peter-boling
951
+ [💖✌️wellfound-img]: https://img.shields.io/badge/peter--boling-orange?style=flat&logo=wellfound
952
+ [💖💲crunchbase]: https://www.crunchbase.com/person/peter-boling
953
+ [💖💲crunchbase-img]: https://img.shields.io/badge/peter--boling-purple?style=flat&logo=crunchbase
954
+ [💖🐘ruby-mast]: https://ruby.social/@galtzo
955
+ [💖🐘ruby-mast-img]: https://img.shields.io/mastodon/follow/109447111526622197?domain=https://ruby.social&style=flat&logo=mastodon&label=Ruby%20@galtzo
956
+ [💖🦋bluesky]: https://bsky.app/profile/galtzo.com
957
+ [💖🦋bluesky-img]: https://img.shields.io/badge/@galtzo.com-0285FF?style=flat&logo=bluesky&logoColor=white
958
+ [💖🌳linktree]: https://linktr.ee/galtzo
959
+ [💖🌳linktree-img]: https://img.shields.io/badge/galtzo-purple?style=flat&logo=linktree
960
+ [💖💁🏼‍♂️devto]: https://dev.to/galtzo
961
+ [💖💁🏼‍♂️devto-img]: https://img.shields.io/badge/dev.to-0A0A0A?style=flat&logo=devdotto&logoColor=white
962
+ [💖💁🏼‍♂️aboutme]: https://about.me/peter.boling
963
+ [💖💁🏼‍♂️aboutme-img]: https://img.shields.io/badge/about.me-0A0A0A?style=flat&logo=aboutme&logoColor=white
964
+ [💖🧊berg]: https://codeberg.org/pboling
965
+ [💖🐙hub]: https://github.org/pboling
966
+ [💖🛖hut]: https://sr.ht/~galtzo/
967
+ [💖🧪lab]: https://gitlab.com/pboling
968
+ [👨🏼‍🏫expsup-upwork]: https://www.upwork.com/freelancers/~014942e9b056abdf86?mp_source=share
969
+ [👨🏼‍🏫expsup-upwork-img]: https://img.shields.io/badge/UpWork-13544E?style=for-the-badge&logo=Upwork&logoColor=white
970
+ [👨🏼‍🏫expsup-codementor]: https://www.codementor.io/peterboling?utm_source=github&utm_medium=button&utm_term=peterboling&utm_campaign=github
971
+ [👨🏼‍🏫expsup-codementor-img]: https://img.shields.io/badge/CodeMentor-Get_Help-1abc9c?style=for-the-badge&logo=CodeMentor&logoColor=white
972
+ [🏙️entsup-tidelift]: https://tidelift.com/subscription/pkg/rubygems-oauth2?utm_source=rubygems-oauth2&utm_medium=referral&utm_campaign=readme
973
+ [🏙️entsup-tidelift-img]: https://img.shields.io/badge/Tidelift_and_Sonar-Enterprise_Support-FD3456?style=for-the-badge&logo=sonar&logoColor=white
974
+ [🏙️entsup-tidelift-sonar]: https://blog.tidelift.com/tidelift-joins-sonar
975
+ [💁🏼‍♂️peterboling]: http://www.peterboling.com
976
+ [🚂railsbling]: http://www.railsbling.com
977
+ [📜src-gl-img]: https://img.shields.io/badge/GitLab-FBA326?style=for-the-badge&logo=Gitlab&logoColor=orange
978
+ [📜src-gl]: https://gitlab.com/ruby-oauth/oauth2
979
+ [📜src-cb-img]: https://img.shields.io/badge/CodeBerg-4893CC?style=for-the-badge&logo=CodeBerg&logoColor=blue
980
+ [📜src-cb]: https://codeberg.org/ruby-oauth/oauth2
981
+ [📜src-gh-img]: https://img.shields.io/badge/GitHub-238636?style=for-the-badge&logo=Github&logoColor=green
982
+ [📜src-gh]: https://github.com/ruby-oauth/oauth2
983
+ [📜docs-cr-rd-img]: https://img.shields.io/badge/RubyDoc-Current_Release-943CD2?style=for-the-badge&logo=readthedocs&logoColor=white
984
+ [📜docs-head-rd-img]: https://img.shields.io/badge/YARD_on_Galtzo.com-HEAD-943CD2?style=for-the-badge&logo=readthedocs&logoColor=white
985
+ [📜gl-wiki]: https://gitlab.com/ruby-oauth/oauth2/-/wikis/home
986
+ [📜gh-wiki]: https://github.com/ruby-oauth/oauth2/wiki
987
+ [📜gl-wiki-img]: https://img.shields.io/badge/wiki-gitlab-943CD2.svg?style=for-the-badge&logo=gitlab&logoColor=white
988
+ [📜gh-wiki-img]: https://img.shields.io/badge/wiki-github-943CD2.svg?style=for-the-badge&logo=github&logoColor=white
989
+ [👽dl-rank]: https://bestgems.org/gems/oauth2
990
+ [👽dl-ranki]: https://img.shields.io/gem/rd/oauth2.svg
991
+ [👽version]: https://bestgems.org/gems/oauth2
992
+ [👽versioni]: https://img.shields.io/gem/v/oauth2.svg
993
+ [🏀qlty-mnt]: https://qlty.sh/gh/ruby-oauth/projects/oauth2
994
+ [🏀qlty-mnti]: https://qlty.sh/gh/ruby-oauth/projects/oauth2/maintainability.svg
995
+ [🏀qlty-cov]: https://qlty.sh/gh/ruby-oauth/projects/oauth2/metrics/code?sort=coverageRating
996
+ [🏀qlty-covi]: https://qlty.sh/gh/ruby-oauth/projects/oauth2/coverage.svg
997
+ [🏀codecov]: https://codecov.io/gh/ruby-oauth/oauth2
998
+ [🏀codecovi]: https://codecov.io/gh/ruby-oauth/oauth2/graph/badge.svg
999
+ [🏀coveralls]: https://coveralls.io/github/ruby-oauth/oauth2?branch=main
1000
+ [🏀coveralls-img]: https://coveralls.io/repos/github/ruby-oauth/oauth2/badge.svg?branch=main
1001
+ [🚎ruby-2.4-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/ruby-2.4.yml
1002
+ [🚎ruby-2.5-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/ruby-2.5.yml
1003
+ [🚎ruby-2.6-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/ruby-2.6.yml
1004
+ [🚎ruby-2.7-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/ruby-2.7.yml
1005
+ [🚎ruby-3.0-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/ruby-3.0.yml
1006
+ [🚎ruby-3.1-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/ruby-3.1.yml
1007
+ [🚎ruby-3.2-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/ruby-3.2.yml
1008
+ [🚎ruby-3.3-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/ruby-3.3.yml
1009
+ [🚎ruby-3.4-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/ruby-3.4.yml
1010
+ [🚎jruby-9.2-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/jruby-9.2.yml
1011
+ [🚎jruby-9.3-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/jruby-9.3.yml
1012
+ [🚎jruby-9.4-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/jruby-9.4.yml
1013
+ [🚎truby-22.3-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/truffleruby-22.3.yml
1014
+ [🚎truby-23.0-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/truffleruby-23.0.yml
1015
+ [🚎truby-23.1-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/truffleruby-23.1.yml
1016
+ [🚎truby-24.2-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/truffleruby-24.2.yml
1017
+ [🚎truby-25.0-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/truffleruby-25.0.yml
1018
+ [🚎2-cov-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/coverage.yml
1019
+ [🚎2-cov-wfi]: https://github.com/ruby-oauth/oauth2/actions/workflows/coverage.yml/badge.svg
1020
+ [🚎3-hd-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/heads.yml
1021
+ [🚎3-hd-wfi]: https://github.com/ruby-oauth/oauth2/actions/workflows/heads.yml/badge.svg
1022
+ [🚎5-st-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/style.yml
1023
+ [🚎5-st-wfi]: https://github.com/ruby-oauth/oauth2/actions/workflows/style.yml/badge.svg
1024
+ [🚎9-t-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/truffle.yml
1025
+ [🚎9-t-wfi]: https://github.com/ruby-oauth/oauth2/actions/workflows/truffle.yml/badge.svg
1026
+ [🚎10-j-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/jruby.yml
1027
+ [🚎10-j-wfi]: https://github.com/ruby-oauth/oauth2/actions/workflows/jruby.yml/badge.svg
1028
+ [🚎11-c-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/current.yml
1029
+ [🚎11-c-wfi]: https://github.com/ruby-oauth/oauth2/actions/workflows/current.yml/badge.svg
1030
+ [🚎12-crh-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/dep-heads.yml
1031
+ [🚎12-crh-wfi]: https://github.com/ruby-oauth/oauth2/actions/workflows/dep-heads.yml/badge.svg
1032
+ [🚎13-🔒️-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/locked_deps.yml
1033
+ [🚎13-🔒️-wfi]: https://github.com/ruby-oauth/oauth2/actions/workflows/locked_deps.yml/badge.svg
1034
+ [🚎14-🔓️-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/unlocked_deps.yml
1035
+ [🚎14-🔓️-wfi]: https://github.com/ruby-oauth/oauth2/actions/workflows/unlocked_deps.yml/badge.svg
1036
+ [🚎15-🪪-wf]: https://github.com/ruby-oauth/oauth2/actions/workflows/license-eye.yml
1037
+ [🚎15-🪪-wfi]: https://github.com/ruby-oauth/oauth2/actions/workflows/license-eye.yml/badge.svg
1038
+ [💎ruby-2.2i]: https://img.shields.io/badge/Ruby-2.2_(%F0%9F%9A%ABCI)-AABBCC?style=for-the-badge&logo=ruby&logoColor=white
1039
+ [💎ruby-2.3i]: https://img.shields.io/badge/Ruby-2.3_(%F0%9F%9A%ABCI)-AABBCC?style=for-the-badge&logo=ruby&logoColor=white
1040
+ [💎ruby-2.4i]: https://img.shields.io/badge/Ruby-2.4-DF00CA?style=for-the-badge&logo=ruby&logoColor=white
1041
+ [💎ruby-2.5i]: https://img.shields.io/badge/Ruby-2.5-DF00CA?style=for-the-badge&logo=ruby&logoColor=white
1042
+ [💎ruby-2.6i]: https://img.shields.io/badge/Ruby-2.6-DF00CA?style=for-the-badge&logo=ruby&logoColor=white
1043
+ [💎ruby-2.7i]: https://img.shields.io/badge/Ruby-2.7-DF00CA?style=for-the-badge&logo=ruby&logoColor=white
1044
+ [💎ruby-3.0i]: https://img.shields.io/badge/Ruby-3.0-CC342D?style=for-the-badge&logo=ruby&logoColor=white
1045
+ [💎ruby-3.1i]: https://img.shields.io/badge/Ruby-3.1-CC342D?style=for-the-badge&logo=ruby&logoColor=white
1046
+ [💎ruby-3.2i]: https://img.shields.io/badge/Ruby-3.2-CC342D?style=for-the-badge&logo=ruby&logoColor=white
1047
+ [💎ruby-3.3i]: https://img.shields.io/badge/Ruby-3.3-CC342D?style=for-the-badge&logo=ruby&logoColor=white
1048
+ [💎ruby-3.4i]: https://img.shields.io/badge/Ruby-3.4-CC342D?style=for-the-badge&logo=ruby&logoColor=white
1049
+ [💎ruby-4.0i]: https://img.shields.io/badge/Ruby-4.0-CC342D?style=for-the-badge&logo=ruby&logoColor=white
1050
+ [💎ruby-c-i]: https://img.shields.io/badge/Ruby-current-CC342D?style=for-the-badge&logo=ruby&logoColor=green
1051
+ [💎ruby-headi]: https://img.shields.io/badge/Ruby-HEAD-CC342D?style=for-the-badge&logo=ruby&logoColor=blue
1052
+ [💎truby-22.3i]: https://img.shields.io/badge/Truffle_Ruby-22.3-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
1053
+ [💎truby-23.0i]: https://img.shields.io/badge/Truffle_Ruby-23.0-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
1054
+ [💎truby-23.1i]: https://img.shields.io/badge/Truffle_Ruby-23.1-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
1055
+ [💎truby-24.2i]: https://img.shields.io/badge/Truffle_Ruby-24.2-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
1056
+ [💎truby-25.0i]: https://img.shields.io/badge/Truffle_Ruby-25.0-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
1057
+ [💎truby-c-i]: https://img.shields.io/badge/Truffle_Ruby-current-34BCB1?style=for-the-badge&logo=ruby&logoColor=green
1058
+ [💎jruby-9.2i]: https://img.shields.io/badge/JRuby-9.2-FBE742?style=for-the-badge&logo=ruby&logoColor=red
1059
+ [💎jruby-9.3i]: https://img.shields.io/badge/JRuby-9.3-FBE742?style=for-the-badge&logo=ruby&logoColor=red
1060
+ [💎jruby-9.4i]: https://img.shields.io/badge/JRuby-9.4-FBE742?style=for-the-badge&logo=ruby&logoColor=red
1061
+ [💎jruby-c-i]: https://img.shields.io/badge/JRuby-current-FBE742?style=for-the-badge&logo=ruby&logoColor=green
1062
+ [💎jruby-headi]: https://img.shields.io/badge/JRuby-HEAD-FBE742?style=for-the-badge&logo=ruby&logoColor=blue
1063
+ [🤝gh-issues]: https://github.com/ruby-oauth/oauth2/issues
1064
+ [🤝gh-pulls]: https://github.com/ruby-oauth/oauth2/pulls
1065
+ [🤝gl-issues]: https://gitlab.com/ruby-oauth/oauth2/-/issues
1066
+ [🤝gl-pulls]: https://gitlab.com/ruby-oauth/oauth2/-/merge_requests
1067
+ [🤝cb-issues]: https://codeberg.org/ruby-oauth/oauth2/issues
1068
+ [🤝cb-pulls]: https://codeberg.org/ruby-oauth/oauth2/pulls
1069
+ [🤝cb-donate]: https://donate.codeberg.org/
1070
+ [🤝contributing]: https://github.com/ruby-oauth/oauth2/blob/main/CONTRIBUTING.md
1071
+ [🏀codecov-g]: https://codecov.io/gh/ruby-oauth/oauth2/graph/badge.svg
1072
+ [🖐contrib-rocks]: https://contrib.rocks
1073
+ [🖐contributors]: https://github.com/ruby-oauth/oauth2/graphs/contributors
1074
+ [🖐contributors-img]: https://contrib.rocks/image?repo=ruby-oauth/oauth2
1075
+ [🚎contributors-gl]: https://gitlab.com/ruby-oauth/oauth2/-/graphs/main
1076
+ [🪇conduct]: https://github.com/ruby-oauth/oauth2/blob/main/CODE_OF_CONDUCT.md
1077
+ [🪇conduct-img]: https://img.shields.io/badge/Contributor_Covenant-2.1-259D6C.svg
1078
+ [📌pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
1079
+ [📌semver]: https://semver.org/spec/v2.0.0.html
1080
+ [📌semver-img]: https://img.shields.io/badge/semver-2.0.0-259D6C.svg?style=flat
1081
+ [📌semver-breaking]: https://github.com/semver/semver/issues/716#issuecomment-869336139
1082
+ [📌major-versions-not-sacred]: https://tom.preston-werner.com/2022/05/23/major-version-numbers-are-not-sacred.html
1083
+ [📌changelog]: https://github.com/ruby-oauth/oauth2/blob/main/CHANGELOG.md
1084
+ [📗keep-changelog]: https://keepachangelog.com/en/1.0.0/
1085
+ [📗keep-changelog-img]: https://img.shields.io/badge/keep--a--changelog-1.0.0-34495e.svg?style=flat
1086
+ [📌gitmoji]: https://gitmoji.dev
1087
+ [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
1088
+ [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
1089
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.542-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
1090
+ [🔐security]: https://github.com/ruby-oauth/oauth2/blob/main/SECURITY.md
1091
+ [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
1092
+ [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
1093
+ [📄license]: LICENSE.md
1094
+ [📄license-ref]: MIT.md
1095
+ [📄license-img]: https://img.shields.io/badge/License-MIT-259D6C.svg
1096
+ [📄license-compat]: https://www.apache.org/legal/resolved.html#category-a
1097
+ [📄license-compat-img]: https://img.shields.io/badge/Apache_Compatible:_Category_A-✓-259D6C.svg?style=flat&logo=Apache
1098
+
1099
+ [📄ilo-declaration]: https://www.ilo.org/declaration/lang--en/index.htm
1100
+ [📄ilo-declaration-img]: https://img.shields.io/badge/ILO_Fundamental_Principles-✓-259D6C.svg?style=flat
1101
+ [🚎yard-current]: http://rubydoc.info/gems/oauth2
1102
+ [🚎yard-head]: https://oauth2.galtzo.com
1103
+ [💎stone_checksums]: https://github.com/galtzo-floss/stone_checksums
1104
+ [💎SHA_checksums]: https://gitlab.com/ruby-oauth/oauth2/-/tree/main/checksums
1105
+ [💎rlts]: https://github.com/rubocop-lts/rubocop-lts
1106
+ [💎rlts-img]: https://img.shields.io/badge/code_style_&_linting-rubocop--lts-34495e.svg?plastic&logo=ruby&logoColor=white
1107
+ [💎appraisal2]: https://github.com/appraisal-rb/appraisal2
1108
+ [💎appraisal2-img]: https://img.shields.io/badge/appraised_by-appraisal2-34495e.svg?plastic&logo=ruby&logoColor=white
1109
+ [💎d-in-dvcs]: https://railsbling.com/posts/dvcs/put_the_d_in_dvcs/
1110
+
1111
+ <!-- kettle-jem:metadata:start -->
1112
+ | Field | Value |
1113
+ |---|---|
1114
+ | Package | oauth2 |
1115
+ | Description | 🔐 A Ruby wrapper for the OAuth 2.0 Authorization Framework, including the OAuth 2.1 draft spec, and OpenID Connect (OIDC) |
1116
+ | Homepage | https://github.com/ruby-oauth/oauth2 |
1117
+ | Source | https://github.com/ruby-oauth/oauth2/tree/v2.0.21 |
1118
+ | License | `MIT` |
1119
+ | Funding | https://github.com/sponsors/pboling, https://issuehunt.io/u/pboling, https://ko-fi.com/pboling, https://liberapay.com/pboling/donate, https://opencollective.com/ruby-oauth, https://patreon.com/galtzo, https://polar.sh/pboling, https://thanks.dev/u/gh/pboling, https://tidelift.com/funding/github/rubygems/oauth2, https://www.buymeacoffee.com/pboling |
1120
+ <!-- kettle-jem:metadata:end -->