Skip to content

Callback processing is broken when Object monkeypatched with Object#info (etc) #898

Closed

Description

@richdrich

Please complete all sections.

Configuration

  • Provider Gem: omniauth-google-oauth2 v1.3.1 (but applies to all)
  • Ruby Version: 2.3.3
  • Framework: rails 4 (any)
  • Platform: OSX (any)

Expected Behavior

If one (perhaps inadvertently) defines Object#info (or #info on any module in global scope) (or #uid, #extra or #credentials), then Omniauth should function normally.

Actual Behavior

An exception is thrown in Strategy#compile_stack which calls &ancestor.send(:info) and Object#info does not return a proc. This is due to this method walking all ancestors expecting them to quack like Strategy (I think) and failing if their #info method does something else.

I fully agree that these monkey patches shouldn't exist, but they can do and will result in a hard to trace error.

Steps to Reproduce

Please list all steps to reproduce the issue.

  • Define a module
module Crazy
 def info(s)
  Rails.logger.info(s)
 end
end
  • Include at top level
include Crazy
  • Attempt to test the Omniauth callback
get '/oauth2/callback'

Caveat

Several people wrote the code that made this happen, I only made the test...

Activity

  1. added theissue type on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions