Recent Releases of https://github.com/omniauth/omniauth
https://github.com/omniauth/omniauth - v2.3.1
Fixed
remember_sign_inno longer raisesKeyErrorwhen called outside the request phase, beforeomniauth.paramsis stored, as when a provider gem's specs callauthorize_paramsdirectly.
Full Changelog: https://github.com/omniauth/omniauth/compare/v2.3.0...v2.3.1
- Ruby
Published by sferik 7 days ago
https://github.com/omniauth/omniauth - v2.3.0
Added
- Let strategies keep the origin and params of several sign-ins in progress at once, for example in several tabs, so each callback gets its own instead of the latest sign-in's. A strategy opts in by calling
remember_sign_inin its request phase with a value the provider sends back, such as OAuth 2.0's state, and overridingcallback_sign_in_key. The latest 5 are stored insession['omniauth.sign_ins'], andomniauth.originandomniauth.paramsstill hold the latest one. See the README. (omniauth-oauth2#195)
Changed
- The gem no longer includes
CHANGELOG.md, which was about half its size. Itschangelog_urilinks to the changelog on GitHub.
Full Changelog: https://github.com/omniauth/omniauth/compare/v2.2.0...v2.3.0
- Ruby
Published by sferik 7 days ago
https://github.com/omniauth/omniauth - v2.2.0
Added
- Add a
full_hostoption for each strategy, as a string or a proc that takes the Rack env. It takes precedence overOmniAuth.config.full_host. (#835) - Ship RBS type signatures for OmniAuth in
sig/. - Document the Rack env keys OmniAuth sets, CSRF protection, sending
originas a form field, and howSameSitesession cookies affect the callback in the README. (#909, #1075, #1048, #1149) - Add this changelog.
Changed
omniauth.paramsnow includes params posted to the request phase's form, not just its query string, so they survive the POST-only request phase introduced in 2.0. Theauthenticity_tokenparam is never included (see CVE-2017-18076 under 1.3.2). If your request form posts other fields, they now appear inomniauth.paramsand are stored in the session until the callback. (#975)OmniAuth::Builderbuilds its middleware stack on the first request and reuses it, instead of rebuilding every strategy on every request. Providers added after the first request are ignored. (#1083, #970)Strategy#callsends a request that isn't on the strategy's request or callback path straight to the app, instead of duplicating the strategy for it. It still duplicates it in test mode, with another_phase, with path lambdas, or when the strategy overrides how#call!dispatches. Methods patched directly ontoOmniAuth::Strategy, rather than overridden in a subclass, aren't detected, so a patched#call!no longer runs for requests outside the strategy's paths. (#1172)- Require Ruby 2.5 or later (was 2.2). (#1167)
- Require Rack 2.2.8 or later (was 2.2.3), rack-protection 2.2.0 or later, and hashie 3.5.2 or later (was 3.4.6).
- The gem now contains only
lib,sig, the license, the README, the changelog, and the security policy.
Fixed
- Run the
before_callback_phasehook for mocked failures in test mode, as for real callbacks. (#1043, #1171) - Recognize callback paths with a format suffix, such as
/auth/:provider/callback.json. (#618, #1170) - Don't fail callbacks when the app defines a method named
uid,info,credentials, orextraonObject. (#898, #1169) - Don't add a calculated
nameto the info hash subsets returned byslice,except,select, andreject. (#892, #1168) - Collapse repeated slashes in the request path, as Rails routing does, so
//auth/:providerfrom a misconfigured proxy reaches the strategy. (#1079) - Avoid "instance variable not initialized" warnings on Ruby before 3.0.
Security
- Guard against forged hosts in callback URLs. Unless a
full_hostis set, OmniAuth builds the callback URL it sends to the provider from the request'sHost,X-Forwarded-Host, orForwardedheader, which a client can forge. The newOmniAuth.config.allowed_hosts, a list of strings and regexps, makes the request and callback phases fail withinvalid_hostunless the request's host matches one of them. Untilfull_hostorallowed_hostsis set, the request phase logs a warning. The README'sfull_hostexample, which copied theHostheader, is fixed. (GHSA-m27g-v28p-f9fx, CVE-2026-63183) - Run
request_validation_phasebefore writingomniauth.paramsto the session, so a cross-site POST rejected by the authenticity check can no longer store attacker-controlled params. (#1162)
Full Changelog: https://github.com/omniauth/omniauth/compare/v2.1.4...v2.2.0
- Ruby
Published by sferik 7 days ago
https://github.com/omniauth/omniauth - v2.1.4
What's Changed
- Add Ruby 3.4 to CI by @tejasbubane in https://github.com/omniauth/omniauth/pull/1142
- Add after_request_phase callback hook by @gerardo-navarro in https://github.com/omniauth/omniauth/pull/1147
Full Changelog: https://github.com/omniauth/omniauth/compare/v2.1.3...v2.1.4
You may now configure an after_request_phase callback on your omniauth builder instance. This callback will be run after the request phase before returning the request result.
- Ruby
Published by BobbyMcWho about 1 year ago
https://github.com/omniauth/omniauth - v2.1.3
What's Changed
- Test against Ruby 3.3 by @enomotodev in https://github.com/omniauth/omniauth/pull/1128
- Exclude (macos, 2.5) from test matrix by @TastyPi in https://github.com/omniauth/omniauth/pull/1137
- Avoid using
URI::ABS_URIby @mame in https://github.com/omniauth/omniauth/pull/1136 - Do not override
omniauth.originin environment in test mode by @TastyPi in https://github.com/omniauth/omniauth/pull/1134
New Contributors
- @TastyPi made their first contribution in https://github.com/omniauth/omniauth/pull/1137
- @mame made their first contribution in https://github.com/omniauth/omniauth/pull/1136
Full Changelog: https://github.com/omniauth/omniauth/compare/v2.1.2...v2.1.3
- Ruby
Published by BobbyMcWho over 1 year ago
https://github.com/omniauth/omniauth - v2.1.2
What's Changed
- Fix
bundle installstep on CI for TruffleRuby by @andrykonchin in https://github.com/omniauth/omniauth/pull/1104 - Use GET with :developer strategy. by @cycomachead in https://github.com/omniauth/omniauth/pull/1106
- Test against Ruby 3.2 by @enomotodev in https://github.com/omniauth/omniauth/pull/1113
- ci: use ubuntu-latest runner by @nschonni in https://github.com/omniauth/omniauth/pull/1109
- chore: add Dependabot for version updates by @nschonni in https://github.com/omniauth/omniauth/pull/1110
- Added Ruby 3.2 to workflow. by @madogiwa0124 in https://github.com/omniauth/omniauth/pull/1102
- chore: Remove conditions for old (J)Ruby by @nschonni in https://github.com/omniauth/omniauth/pull/1118
- fix: conditional delegate require Rack/JRuby by @nschonni in https://github.com/omniauth/omniauth/pull/1122
New Contributors
- @andrykonchin made their first contribution in https://github.com/omniauth/omniauth/pull/1104
- @cycomachead made their first contribution in https://github.com/omniauth/omniauth/pull/1106
- @nschonni made their first contribution in https://github.com/omniauth/omniauth/pull/1109
- @madogiwa0124 made their first contribution in https://github.com/omniauth/omniauth/pull/1102
Full Changelog: https://github.com/omniauth/omniauth/compare/v2.1.1...v2.1.2
- Ruby
Published by BobbyMcWho over 1 year ago
https://github.com/omniauth/omniauth - v2.1.1
What's Changed
- Separate jruby and truffle ruby workflows by @BobbyMcWho in https://github.com/omniauth/omniauth/pull/1065
- Added docs showing how to integrate omniauth with rack_csrf by @HoneyryderChuck in https://github.com/omniauth/omniauth/pull/1070
- Fixed nil error in callback_path by @shreyakurian02 in https://github.com/omniauth/omniauth/pull/1092
New Contributors
- @HoneyryderChuck made their first contribution in https://github.com/omniauth/omniauth/pull/1070
- @shreyakurian02 made their first contribution in https://github.com/omniauth/omniauth/pull/1092
Full Changelog: https://github.com/omniauth/omniauth/compare/v2.1.0...v2.1.1
- Ruby
Published by BobbyMcWho over 1 year ago
https://github.com/omniauth/omniauth - v1.9.2
Backports a vulnerability fix that was included in Omniauth 2.0 release to the 1.9 channel.
https://nvd.nist.gov/vuln/detail/CVE-2020-36599
Current Omniauth security policy maintains v2.0 and v2.1 channels for security releases, and security patches should not be typically expected for the v1.9 channel.
- Ruby
Published by BobbyMcWho about 4 years ago
https://github.com/omniauth/omniauth - v2.1.0
This release adds Ruby 3.0+ support.
Due to kwarg changes in ruby 3, we have bumped the minimum required version of Rack to 2.2.3, which is where ruby3 support was added.
Releasing as a minor as dependency resolution should fail at install if an application is locked to a rack below new minimum.
Full Changelog: https://github.com/omniauth/omniauth/compare/v2.0.4...v2.1.0
- Ruby
Published by BobbyMcWho over 4 years ago
https://github.com/omniauth/omniauth - v2.0.4
This release removes unnecessary warning logging when accessing GET routes that are not related to the OmniAuth request path.
Thanks to @charlie-wasp and @sponomarev at Evil Martians for the bug find and subsequent PR.
- Ruby
Published by BobbyMcWho over 5 years ago
https://github.com/omniauth/omniauth - Fix rescuing of application errors when call_app! is used.
As a consequence of the changes that were merged in #689, errors
thrown by strategies that utilize other_phase (or more specifically
call_app!), would be caught by omniauth, causing headaches for folks
looking to have those errors handled by their application. This
should allow for errors that come from the app to pass through, while
passing errors that come from the authentication phases to the fail!
handler.
Resolves #1030
- Ruby
Published by BobbyMcWho over 5 years ago
https://github.com/omniauth/omniauth - Fix for incorrect order of request_validation_phase in test_mode.
@jsdalton gave an awesome report of the issue present in test_mode in #1033
The current implementation of mock_call was verifying the token for all requests, regardless of whether the current path is on the omniauth request path. The change was introduced recently in 1b784ff. See #1032 for details.
This creates two problems:
- When test mode is on, the authenticity verification logic is run inappropriately against requests where this may not even be wanted.
- The behavior varies from actual production behavior, potentially allowing bugs to be introduced by unwary developers.
Note that this bug was only present when OmniAuth was configured for test_mode and using the mock_call phases.
- Ruby
Published by BobbyMcWho almost 6 years ago
https://github.com/omniauth/omniauth - Allow passing rack-protection configuration to default request_validation_phase
This release now properly allows an instance of OmniAuth::AuthenticityTokenProtection (with passed in rack-protection configuration) to be used as the request_validation_phase.
Thanks @jkowens #1027
If you haven't already read the release notes for v2.0.0, you should do so.
- Ruby
Published by BobbyMcWho almost 6 years ago
https://github.com/omniauth/omniauth - v2.0.0
Version 2.0 of OmniAuth includes some changes that may be breaking depending on how you use OmniAuth in your app.
Many thanks to the folks who contributed in code and discussion for these changes.
OmniAuth now defaults to only POST as the allowed request_phase method.
Hopefully, you were already doing this as a result of the warnings due to CVE-2015-9284.
For detailed context, see:
#960
#809
Resolving CVE-2015-9284
This change also includes an additional configurable phase: request_validation_phase.
Rack/Sinatra
By default, this uses rack-protection's AuthenticityToken class to validate authenticity tokens. If you are using a rack based framework like sinatra, you can find an example of how to add authenticity tokens to your view here.
Rails
Because Rails handles its CSRF protection in its RequestForgeryProtection class, and stores tokens in a non-vanilla-rack friendly way, you must pass a rails-friendly validator in instead, similar to what omniauth-rails_csrf_protection does.
Update: omniauth-rails_csrf_protection has released v1.0.0, which means if you're using this library already, you should be able to upgrade omniauth to the 2.0 series as long as omniauth-rails_csrf_protection is also upgraded '~> 1.0'
An example of creating your own non-dependency implementation is below, though I would recommend using the gem.
# Derived from https://github.com/cookpad/omniauth-rails_csrf_protection/blob/master/lib/omniauth/rails_csrf_protection/token_verifier.rb
# This specific implementation has been pared down and should not be taken as the most correct way to do this.
class TokenVerifier
include ActiveSupport::Configurable
include ActionController::RequestForgeryProtection
def call(env)
@request = ActionDispatch::Request.new(env.dup)
raise OmniAuth::AuthenticityError unless verified_request?
end
private
attr_reader :request
delegate :params, :session, to: :request
end
# in an initializer
OmniAuth.config.request_validation_phase = TokenVerifier.new
If you're using Rails' form helpers, they automatically include an authenticity token.
If you are using hyperlinks or buttons styled to redirect to your login route, you should update these to be a submit input or a submit type button wrapped in a form.
- <a href='/auth/developer'>Login with Developer</a>
+ <%= form_tag('/auth/developer', method: 'post') do %>
+ <button type='submit'>Login with Developer</button>
+ <% end %>
GET
Because using GET for login poses concerns (see OWASP Cheatsheet), after upgrading OmniAuth will log a :warn level log with every GET request to a login path when your OmniAuth.config.allowed_request_methods include :get.
If you have a workflow that absolutely requires you to use GET for the request_phase, you can disable this warning using
OmniAuth.config.silence_get_warning = true
It is very important that you do not do this just to circumvent having to change your inputs or login flow, as using GET for most auth workflows is not what you want.
Unhandled Exceptions
OmniAuth now catches exceptions raised during the options_call, request_call, callback_call, and other_phase, and passes them to the OmniAuth.config.on_failure handler. For most apps, this means they are passed to the default FailureEndpoint class that OmniAuth provides, and redirected to /auth/failure. If your app is wrapping OmniAuth in another middleware such as this example in Discourse, then you may need to instead write your own failure handler.
Provider Namespacing
OmniAuth will no longer find constants from an ancestor class when looking for the strategy class. What this means is that
OmniAuth.builder.new(@app) do
provider :my_provider
end
Will no longer find ::MyProvider as a strategy, and instead will only look under the OmniAuth::Strategies namespace for the MyProvider class.
Failure Route
The failure route will now respect a strategy's path_prefix option, meaning if your strategy uses /external instead of /auth as its path prefix, the failure route for that strategy will be /external/failure.
Thread Safety
The OmniAuth middleware should now be thread-safe, as we run tests with rack-freeze to check for middleware mutability. This does not guarantee that the downstream strategy is thread-safe however. If you have concerns, ask your strategy maintainers.
Frozen Strings
OmniAuth will no longer throw errors if trying to run it in an app with RUBYOPT="--enable-frozen-string-literal".
Relative Root Apps
OmniAuth now respects the 'SCRIPT_NAME' env value, so if your app lives at myapp.com/super, your request path will be /super/auth/provider, your callback path /super/auth/provider/callback and your failure path /super/auth/failure.
- Ruby
Published by BobbyMcWho almost 6 years ago
https://github.com/omniauth/omniauth - v2.0.0 Release Candidate 1
Release candidates should not be considered production-ready nor stable.
Version 2.0 of OmniAuth includes some changes that may be breaking depending on how you use OmniAuth in your app.
Many thanks to the folks who contributed in code and discussion for these changes.
OmniAuth now defaults to only POST as the allowed request_phase method.
Hopefully, you were already doing this as a result of the warnings due to CVE-2015-9284.
For detailed context, see:
#960
#809
Resolving CVE-2015-9284
This change also includes an additional configurable phase: request_validation_phase.
Rack/Sinatra
By default, this uses rack-protection's AuthenticityToken class to validate authenticity tokens. If you are using a rack based framework like sinatra, you can find an example of how to add authenticity tokens to your view here.
Rails
Because Rails handles its CSRF protection in its RequestForgeryProtection class, and stores tokens in a non-vanilla-rack friendly way, you must pass a rails-friendly validator in instead, similar to what omniauth-rails_csrf_protection does.
# Derived from https://github.com/cookpad/omniauth-rails_csrf_protection/blob/master/lib/omniauth/rails_csrf_protection/token_verifier.rb
# This specific implementation has been pared down and should not be taken as the most correct way to do this.
class TokenVerifier
include ActiveSupport::Configurable
include ActionController::RequestForgeryProtection
def call(env)
@request = ActionDispatch::Request.new(env.dup)
raise OmniAuth::AuthenticityError unless verified_request?
end
private
attr_reader :request
delegate :params, :session, to: :request
end
# in an initializer
OmniAuth.config.request_validation_phase = TokenVerifier.new
Alternatively, if you're already using the omniauth-rails_csrf_protection gem, I have a PR open (https://github.com/cookpad/omniauth-rails_csrf_protection/pull/9) that you can use my branch to automatically configure the request_validation_phase.
If you're using Rails' form helpers, they automatically include an authenticity token.
If you are using hyperlinks or buttons styled to redirect to your login route, you should update these to be a submit input or a submit type button wrapped in a form.
- <a href='/auth/developer'>Login with Developer</a>
+ <%= form_tag('/auth/developer', method: 'post') do %>
+ <button type='submit'>Login with Developer</button>
+ <% end %>
GET
Because using GET for login poses concerns (see OWASP Cheatsheet), after upgrading OmniAuth will log a :warn level log with every GET request to a login path when your OmniAuth.config.allowed_request_methods include :get.
If you have a workflow that absolutely requires you to use GET for the request_phase, you can disable this warning using
OmniAuth.config.silence_get_warning = true
It is very important that you do not do this just to circumvent having to change your inputs or login flow, as using GET for most auth workflows is not what you want.
Unhandled Exceptions
OmniAuth now catches exceptions raised during the options_call, request_call, callback_call, and other_phase, and passes them to the OmniAuth.config.on_failure handler. For most apps, this means they are passed to the default FailureEndpoint class that OmniAuth provides, and redirected to /auth/failure. If your app is wrapping OmniAuth in another middleware such as this example in Discourse, then you may need to instead write your own failure handler.
Provider Namespacing
OmniAuth will no longer find constants from an ancestor class when looking for the strategy class. What this means is that
OmniAuth.builder.new(@app) do
provider :my_provider
end
Will no longer find ::MyProvider as a strategy, and instead will only look under the OmniAuth::Strategies namespace for the MyProvider class.
Failure Route
The failure route will now respect a strategy's path_prefix option, meaning if your strategy uses /external instead of /auth as its path prefix, the failure route for that strategy will be /external/failure.
Thread Safety
The OmniAuth middleware should now be thread-safe, as we run tests with rack-freeze to check for middleware mutability. This does not guarantee that the downstream strategy is thread-safe however. If you have concerns, ask your strategy maintainers.
Frozen Strings
OmniAuth will no longer throw errors if trying to run it in an app with RUBYOPT="--enable-frozen-string-literal".
Relative Root Apps
OmniAuth now respects the 'SCRIPT_NAME' env value, so if your app lives at myapp.com/super, your request path will be /super/auth/provider, your callback path /super/auth/provider/callback and your failure path /super/auth/failure.
- Ruby
Published by BobbyMcWho almost 6 years ago
https://github.com/omniauth/omniauth - v1.9.1
This release includes minor changes that remove code specific to rack versions we no longer support, it also loosens the top-end of the version of hashie we require.
No breaking changes are expected with this change. If a breaking change has been introduced with this release, please open an issue.
You can view a list of commits and changed files here: https://github.com/omniauth/omniauth/compare/v1.9.0...v1.9.1
- Ruby
Published by BobbyMcWho over 6 years ago
https://github.com/omniauth/omniauth - v1.9.0
- Update
rackto>=2.0.6per CVE-2018-16471 - Allows usage of Hashie up to
3.7.0 - Fixes Rubocop offenses.
- Ruby
Published by tmilewski almost 8 years ago
https://github.com/omniauth/omniauth - v1.8.1
- Fix CVE-2017-17042
- Ruby
Published by tmilewski almost 9 years ago
https://github.com/omniauth/omniauth - v1.8.0
- Use
warnover$stderr.puts
- Ruby
Published by tmilewski almost 9 years ago
https://github.com/omniauth/omniauth - v1.7.1
- Update
mock_request_callto use the same logic as #912. (PR: #913)
- Ruby
Published by tmilewski about 9 years ago
https://github.com/omniauth/omniauth - v1.7.0
- Allow for
originparam to be renamed or disabled. (PR: #912; Issue: #910)
- Ruby
Published by tmilewski about 9 years ago
https://github.com/omniauth/omniauth - v1.6.1
Fixes
- Revert #806 - "Sets
omniauth.headerson the request phase" due toActionDispatch::Cookies::CookieOverflowissues. (PR: #889; Issue: #888)
- Ruby
Published by tmilewski over 9 years ago
https://github.com/omniauth/omniauth - v1.6.0
Updates / Fixes
- Performance benchmarks for middleware call (PR: #775)
- Simplify Default Strategy Options (PR: #777)
- Improve perf by using
Hashie::Mash#[](PR: #778) - Pass through
test_modewith alternate request method (PR: #779) - Avoid Minitest warnings (PR: #850)
- Set
omniauth.headerson the request phase (PR: #806) - Set params when mocking a failure (PR: #812; Issue: #811)
- docs: TestCase expects class in strategy method array (PR: #868)
- Update
AuthHash#regular_writerto ensure that#infois a Hash (#848) - Loosen
hashierequirements to fix potential performance issues. Please define3.4.6in your Gemfile if you experience issues with3.5.x. (PR: #887; Issue: #886)
- Ruby
Published by tmilewski over 9 years ago
https://github.com/omniauth/omniauth - v1.5.0
Defined Support
- Required Ruby version:
>= 2.1.9
Fixes
- Updated Hashie's
disable_warningssetting
Updated Dependencies & Security Updates
jruby-openssl-~> 0.9.19rake->= 12.0yard->= 0.9hashie-~> 3.5.0json-~> 2.0.3mime-types-~> 3.1rest-client-~> 2.0.0rspec-~> 3.5.0rubocop->= 0.47simplecov->= 0.13tins-~> 1.13.0bundler-~> 1.14
Dropped Support
jruby-19mode(EOL)1.9.3(EOL)2.0.0(EOL)
- Ruby
Published by tmilewski almost 10 years ago
https://github.com/omniauth/omniauth - v1.4.3
Security
Updates the following gem requirements to avoid dependency-related security issues:
jruby-opensslrackrest-client
- Ruby
Published by tmilewski almost 10 years ago
https://github.com/omniauth/omniauth - v1.4.2
Fixes
- Mitigate Hashie regressions
- Ruby
Published by tmilewski almost 10 years ago
https://github.com/omniauth/omniauth - v1.4.1
Security Updates
- Update Rack to
=> 1.6.2
- Ruby
Published by tmilewski almost 10 years ago
https://github.com/omniauth/omniauth - v1.4.0
Dropped
- Dropped support Ruby 1.8.7
Fixed
- Silence Hashie::Mash logger on Hashie 3.5.0+
- Use secure URL for OpenID asset
- Ruby
Published by tmilewski almost 10 years ago