"undefined method `uses_extension' for ..."
When the Rails application receives the callback the above error is generated. No idea why.
Rails.application.config.middleware.use OmniAuth::Builder do
provider :google_apps, domain: 'http://domain.com'
end
Try removing the http://
Rails.application.config.middleware.use OmniAuth::Builder do
provider :google_apps, domain: 'domain.com'
end
I am experiencing the same issue with one of my applications.
Rails.application.config.middleware.use OmniAuth::Builder do
provider :google_apps, domain: 'domain.com'
end
undefined method `uses_extension' for #String:0x007fa5f3cf6d18
block in verify_discovery_singleruby-openid (2.3.0) lib/openid/consumer/idres.rb line 464
if !endpoint.uses_extension(type_uri)
endpoint is a string.
>> endpoint
=> "<OpenID::OpenIDServiceEndpoint server_url=https://www.google.com/a/domain.com/o8/ud?be=o8 claimed_id= local_id= canonical_id= used_yadis=true>"
>> endpoint.class
=> String
Here is a list of possibly relevant gems.
- omniauth (1.2.2)
- omniauth-google-apps (0.1.0)
- omniauth-openid (1.0.1)
- ruby-openid (2.3.0)
- ruby-openid-apps-discovery (1.2.0)
Any suggestions to troubleshoot this would greatly be appreciated.
After some digging into ruby-openid it appears that the issues is with the OpenID::Consumer class with setting and getting of values from the ActionDispatch::Request::Session. The method last_requested_endpoint is returning the a string value of the Ruby object instead of the actual object.
At this point I'm not sure is this is an ActionDispatch or OpenID issue.
The issues appears to be with Rails 4.1 and OpenID, see this issue thread for a possible resolution https://github.com/openid/ruby-openid/issues/75.
Rails.application.config.action_dispatch.cookies_serializer = :marshal
@ttdonovan Thank you for the info. Can you attach your whole Gemfile.lock, I'll take a dig. Thank you.
@sishen I've included a link to a copy of my Gemfile.lock.
https://gist.github.com/ttdonovan/eee3d83468fad2018130#file-gemfile-lock
I feel the issue resides in the ruby-openid gem with Rails 4. Even in the upgrade Rails guide there is a call out about serializing objects in the session.
When using the :json or :hybrid serializer, you should beware that not all Ruby objects can be serialized as JSON. For example, Date and Time objects will be serialized as strings, and Hashes will have their keys stringified.
http://guides.rubyonrails.org/upgrading_ruby_on_rails.html#cookies-serializer