reu / omniauth-steam

Steam authentication strategy for OmniAuth
93 stars 38 forks source link

Rails 4.1 cookies_serializer :json setting and ruby-openid incompatibility #12

Open weimeng opened 10 years ago

weimeng commented 10 years ago

Just thought I'd let the maintainers for this gem know of this issue I'm facing when using the omniauth-steam gem together with Rails 4.1 with the new cookies_serializer option set to JSON.

The OpenID object used by the ruby-openid gem dependency/library cannot be serialized as JSON and this causes all sorts of exceptions to occur downstream. The solution is to switch the setting in config/initializers/cookies_serializer.rb to :marshal.

More details here: https://github.com/openid/ruby-openid/issues/75#issuecomment-45532184

I'm not sure if there's a way to avoid using ruby-openid and I'm not sure if the omniauth-steam gem is right place to address or even discuss this issue, but I thought I'd leave this here if anyone else comes looking for a solution.

reu commented 10 years ago

Thanks for the report! I am willing to remove the ruby-openid dependency for a long time, maybe I will have to do this now.

teliosdev commented 10 years ago

There's also an issue with grosser/rack-openid#5, which is kinda annoying...

raldred commented 9 years ago

+1 Having this also with Rails 4.1 with :json it caues downstream error in ruby-openid This seems to have been patched in the ruby-openid gem as of https://github.com/openid/ruby-openid/pull/79

Until this is pushed to rubygems, adding the following to your Gemfile before gem 'omniauth-steam' with fix it allowing cookies_serializer = :json Eg.

gem 'ruby-openid', git: 'https://github.com/openid/ruby-openid.git'
gem 'omniauth-steam'
lephuongbg commented 9 years ago

ruby-openid has been updated to v2.6, which fixed this error.

raldred commented 9 years ago

Great, this can be closed then?

weimeng commented 9 years ago

Not yet, @reu has to update the ruby-openid dependency on the gem first.

reu commented 9 years ago

Well, actually I can't really say that is the proper course of action regarding this issue. The ruby-openid is a dependency rack-openid which is a dependency of omniauth-openid which omniauth-steam depends to. I can pin the ruby-openid version here on omnitauth-steam of course, but that is not really the correct way to solve this issue.

I will try to force the version here and I hope we don't run into any unexpected behaviour.

Newskin01 commented 8 years ago

I'm still experiencing this issue that supposedly was fixed in when openid was updated.

I'm using the following:

weimeng's suggestion works, but I'd like to use :json or :hybrid and neither are working properly. Did something else change?