Giter VIP home page Giter VIP logo

omniauth-steam's Introduction

OmniAuth Steam

This gem is an OmniAuth 1.0 strategy, supporting the Steam OpenID provider.

Usage

Add to your Gemfile:

gem 'omniauth-steam'

And then integrate the strategy into your middleware:

use OmniAuth::Builder do
  provider :steam, "my-steam-web-api-key"
end

If you are using Rails, you may want to add it to the middleware stack:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :steam, ENV['STEAM_WEB_API_KEY']
end

You will need to provide your Steam Web API key to be able to retrieve information about the authenticated user. You can request one by filling out this form.

For additional information, please refer to the OmniAuth wiki.

Authentication Hash

Here's an example of the Authentication Hash available in request.env['omniauth.auth']

{
  :provider => "steam",
  :uid => "76561198010202071",
  :info => {
    :nickname => "Reu",
    :name => "Rodrigo Navarro",
    :location => "BR",
    :image => "http://media.steampowered.com/steamcommunity/public/images/avatars/3c/3c91a935dca0c1e243f3a67a198b0abea9cf6d48_medium.jpg",
    :urls => {
      :Profile => "http://steamcommunity.com/id/rnavarro1/"
    }
  },
  :credentials => {},
  :extra => {
    :raw_info => {
      :steamid => "76561198010202071",
      :communityvisibilitystate => 3,
      :profilestate => 1,
      :personaname => "Reu",
      :lastlogoff => 1325637158,
      :profileurl => "http://steamcommunity.com/id/rnavarro1/",
      :avatar => "http://media.steampowered.com/steamcommunity/public/images/avatars/3c/3c91a935dca0c1e243f3a67a198b0abea9cf6d48.jpg",
      :avatarmedium => "http://media.steampowered.com/steamcommunity/public/images/avatars/3c/3c91a935dca0c1e243f3a67a198b0abea9cf6d48_medium.jpg",
      :avatarfull => "http://media.steampowered.com/steamcommunity/public/images/avatars/3c/3c91a935dca0c1e243f3a67a198b0abea9cf6d48_full.jpg",
      :personastate => 1,
      :realname => "Rodrigo Navarro",
      :primaryclanid => "103582791432706194",
      :timecreated => 1243031082,
      :loccountrycode => "BR"
    }
  }
}

omniauth-steam's People

Contributors

btalbot avatar deekor avatar defaye avatar erictaylor avatar mistertakaashi avatar reu avatar spajus avatar vishnukool avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

omniauth-steam's Issues

Should redirect to failure path if Steam is not available

Sometimes Steam is in maintenance or otherwise down, and OmniAuth can't access Steam's servers. Rather than causing a server error, it should redirect to the failure page and indicate that Steam is down and to try authenticating later.

Steam OpenID with Rails API

Are there any good examples on using this for steam authentication with a Rails web API? So far all the examples that I have seen are specifically for a Rails web application.

Need a Help, Pls!

Hello, Im new in WebDevelopment and especially in Rails. I tried to install without "Devise", only using omniauth. Trying to callback HASH request as like in Railscasts (https://youtu.be/KOnRf1K6Eg8?t=4m42s). How can i do?

I really wiill be appreciate to help. Thank You!

Update on rubygems?

Hey, I ran into the https error in #30 that was fixed by 5a6cc0d. When I switched by Gemfile from

gem 'omniauth-steam'

to:

gem 'omniauth-steam', github: 'reu/omniauth-steam'

It fixed the issue. I think you need to increment the version and republish to rubygems, no?

add_camelization

/Users/streek/.rvm/gems/ruby-1.9.3-p194/gems/omniauth-1.1.1/lib/omniauth.rb:95:in add_camelization': undefined method[]=' for nil:NilClass (NoMethodError)
from /Users/streek/.rvm/gems/ruby-1.9.3-p194/gems/omniauth-openid-1.0.1/lib/omniauth/strategies/open_id.rb:121:in <top (required)>' from /Users/streek/.rvm/gems/ruby-1.9.3-p194/gems/omniauth-steam-1.0.0/lib/omniauth/strategies/steam.rb:3:inmodule:Strategies'
from /Users/streek/.rvm/gems/ruby-1.9.3-p194/gems/omniauth-steam-1.0.0/lib/omniauth/strategies/steam.rb:2:in <module:OmniAuth>' from /Users/streek/.rvm/gems/ruby-1.9.3-p194/gems/omniauth-steam-1.0.0/lib/omniauth/strategies/steam.rb:1:in<top (required)>'
from /Users/streek/.rvm/gems/ruby-1.9.3-p194/gems/omniauth-steam-1.0.0/lib/omniauth-steam.rb:2:in require' from /Users/streek/.rvm/gems/ruby-1.9.3-p194/gems/omniauth-steam-1.0.0/lib/omniauth-steam.rb:2:in<top (required)>'
from /Users/streek/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in require' from /Users/streek/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:inblock (2 levels) in require'
from /Users/streek/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in each' from /Users/streek/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:inblock in require'
from /Users/streek/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in each' from /Users/streek/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:inrequire'
from /Users/streek/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.2.1/lib/bundler.rb:128:in require' from /Users/streek/Dropbox/Website Development/randomsteamgame/config/application.rb:7:in<top (required)>'
from /Users/streek/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands.rb:53:in require' from /Users/streek/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands.rb:53:inblock in <top (required)>'
from /Users/streek/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands.rb:50:in tap' from /Users/streek/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands.rb:50:in<top (required)>'
from script/rails:6:in require' from script/rails:6:in

'
Keith-Connollys-MacBook-Pro:randomsteamgame streek$

undefined method `uses_extension' for #<String:0x7>

Tried nearly everything I can think of for this error. The example works just fine however.

Parameters:

{"_method"=>"post",
"openid.ns"=>"http://specs.openid.net/auth/2.0",
"openid.mode"=>"id_res",
"openid.op_endpoint"=>"https://steamcommunity.com/openid/login",
"openid.claimed_id"=>"http://steamcommunity.com/openid/id/64bitsteamid",
"openid.identity"=>"http://steamcommunity.com/openid/id/64bitsteamid",
"openid.return_to"=>"http://localhost:3000/auth/steam/callback?_method=post",
"openid.response_nonce"=>"2014-04-30T03:47:26ZnbSEeVm7DjgY1QLFlquXiYfYVmI=",
"openid.assoc_handle"=>"1234567890",
"openid.signed"=>"signed,
op_endpoint,
claimed_id,
identity,
return_to,
response_nonce,
assoc_handle",
"openid.sig"=>"5CxA8T+POXub6625FVYgO/9BRPc="}

Rails 4.1 cookies_serializer :json setting and ruby-openid incompatibility

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: openid/ruby-openid#75 (comment)

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.

Is this gem still up2date?

Hey I am trying to use this gem within my rails 6 application and I have some issue.
Is it possible to have an updated example available for this gem?

As far as I know by now the usage of devise is not needed when I was to authenticate a user via steam and create a user.
BUT I have issues to authenticate.

Best Regards

Dennis

Oauth broken with latest steam updated

Hi, getting a weird issue with steam oauth now:

2014-04-09T16:18:47.836005+00:00 app[web.1]: NoMethodError (undefined method `[]' for nil:NilClass):
2014-04-09T16:18:47.836196+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/omniauth-steam-1.0.3/lib/omniauth/strategies/steam.rb:39:in `player'
2014-04-09T16:18:47.836196+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/omniauth-steam-1.0.3/lib/omniauth/strategies/steam.rb:17:in `block in <class:Steam>'
2014-04-09T16:18:47.836196+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:105:in `instance_eval'
2014-04-09T16:18:47.836196+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:105:in `block in compile_stack'
2014-04-09T16:18:47.836196+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:104:in `each'
2014-04-09T16:18:47.836196+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:104:in `inject'
2014-04-09T16:18:47.836196+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:104:in `compile_stack'
2014-04-09T16:18:47.836196+00:00 app[web.1]:   (eval):7:in `info_stack'
2014-04-09T16:18:47.836196+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:321:in `info'
2014-04-09T16:18:47.836196+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:334:in `auth_hash'
2014-04-09T16:18:47.836698+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:361:in `callback_phase'
2014-04-09T16:18:47.836698+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/omniauth-openid-1.0.1/lib/omniauth/strategies/open_id.rb:81:in `callback_phase'
2014-04-09T16:18:47.836698+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:227:in `callback_call'
2014-04-09T16:18:47.836698+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:184:in `call!'
2014-04-09T16:18:47.837360+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2014-04-09T16:18:47.837360+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2014-04-09T16:18:47.837360+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2014-04-09T16:18:47.836698+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:164:in `call'
2014-04-09T16:18:47.836698+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/builder.rb:59:in `call'
2014-04-09T16:18:47.836698+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/etag.rb:23:in `call'
2014-04-09T16:18:47.836698+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/conditionalget.rb:25:in `call'
2014-04-09T16:18:47.836698+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
2014-04-09T16:18:47.836698+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
2014-04-09T16:18:47.836875+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/flash.rb:241:in `call'
2014-04-09T16:18:47.836875+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in `context'
2014-04-09T16:18:47.836875+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in `call'
2014-04-09T16:18:47.836875+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/cookies.rb:486:in `call'
2014-04-09T16:18:47.836875+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/query_cache.rb:36:in `call'
2014-04-09T16:18:47.836875+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
2014-04-09T16:18:47.836875+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
2014-04-09T16:18:47.836875+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/callbacks.rb:373:in `_run__4175763039186087722__call__callbacks'
2014-04-09T16:18:47.836875+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/callbacks.rb:80:in `run_callbacks'
2014-04-09T16:18:47.836875+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
2014-04-09T16:18:47.837188+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
2014-04-09T16:18:47.837188+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
2014-04-09T16:18:47.837188+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2014-04-09T16:18:47.837188+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/rack/logger.rb:38:in `call_app'
2014-04-09T16:18:47.837188+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/rack/logger.rb:21:in `block in call'
2014-04-09T16:18:47.837188+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/tagged_logging.rb:67:in `block in tagged'
2014-04-09T16:18:47.837188+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/tagged_logging.rb:25:in `tagged'
2014-04-09T16:18:47.837188+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/tagged_logging.rb:67:in `tagged'
2014-04-09T16:18:47.837188+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/rack/logger.rb:21:in `call'
2014-04-09T16:18:47.837188+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2014-04-09T16:18:47.837360+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2014-04-09T16:18:47.837360+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2014-04-09T16:18:47.837360+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2014-04-09T16:18:47.837360+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/static.rb:64:in `call'
2014-04-09T16:18:47.837360+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:511:in `call'
2014-04-09T16:18:47.837360+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:97:in `call'
2014-04-09T16:18:47.837360+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2014-04-09T16:18:47.837702+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-04-09T16:18:47.837702+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'

thought it was an issue with my code at first, but I'm guessing its something related to steam changing the way data is sent

Does it work with latest RoR ?

Hello, i'm trying to implement this gem in my fresh new project, i tried the example but i can't get the name and avatar shows, the code is exactly the same as the example, if i clone the repo and checkout in the example branch and try it works, i'm assuming that is about something to do with the latest versions of RoR.
From the console the only meaninful error i got is this (right after the steam callback):
I, [2014-11-09T18:32:47.981539 #4785] INFO -- OpenID: Error attempting to use s tored discovery information: OpenID::TypeURIMismatch

Anyone can login using self-owned fake openid server

This plugin acccepts params:

"openid.op_endpoint"=>"https://steamcommunity.com/openid/login",
"openid.claimed_id"=>"http://steamcommunity.com/openid/id/64bitsteamid",
"openid.identity"=>"http://steamcommunity.com/openid/id/64bitsteamid"

Turned out that attacker can modify op_endpoint and/or other steamcommunity links and route auth request to self-owned openid server which will grant access to any steam id of choice. That way attacker is able to authenticate as any user on site, having it's steam64 id.

Right this vulnerability can be closed using global middleware - to check that openid.op_endpoint must start with https://steamcommunity.com/openid and openid.claimed_id, openid.identity must start with http://steamcommunity.com/openid , otherwise request will fail.

invalid credentials

i am using rails 4 web apps, and after login, auth callback give error message Omniauth:Error 'invalid credentials'

Help !! NoMethodError undefined method `[]' for nil:NilClass

HI there, I'm following this tutorial : https://github.com/bodrovis/Sitepoint-source/tree/master/Dota_on_Rails
when I filled out the steam account info , this error came out:

undefined method `[]' for nil:NilClass
Extracted source (around line #39):
37
38 def player
39 @player ||= raw_info["response"]["players"].first
40 end
41
42 def steam_id

Rails.root: /home/ubuntu/workspace

Application Trace | Framework Trace | Full Trace
omniauth-steam (1.0.3) lib/omniauth/strategies/steam.rb:39:in player' omniauth-steam (1.0.3) lib/omniauth/strategies/steam.rb:17:inblock in class:Steam'
omniauth (1.2.2) lib/omniauth/strategy.rb:105:in instance_eval' omniauth (1.2.2) lib/omniauth/strategy.rb:105:inblock in compile_stack'
omniauth (1.2.2) lib/omniauth/strategy.rb:104:in each' omniauth (1.2.2) lib/omniauth/strategy.rb:104:ininject'
omniauth (1.2.2) lib/omniauth/strategy.rb:104:in compile_stack' (eval):7:ininfo_stack'
omniauth (1.2.2) lib/omniauth/strategy.rb:321:in info' omniauth (1.2.2) lib/omniauth/strategy.rb:334:inauth_hash'
omniauth (1.2.2) lib/omniauth/strategy.rb:361:in callback_phase' omniauth-openid (1.0.1) lib/omniauth/strategies/open_id.rb:81:incallback_phase'
omniauth (1.2.2) lib/omniauth/strategy.rb:227:in callback_call' omniauth (1.2.2) lib/omniauth/strategy.rb:184:incall!'
omniauth (1.2.2) lib/omniauth/strategy.rb:164:in call' omniauth (1.2.2) lib/omniauth/builder.rb:59:incall'
rack (1.6.1) lib/rack/etag.rb:24:in call' rack (1.6.1) lib/rack/conditionalget.rb:25:incall'
rack (1.6.1) lib/rack/head.rb:13:in call' actionpack (4.2.1) lib/action_dispatch/middleware/params_parser.rb:27:incall'
actionpack (4.2.1) lib/action_dispatch/middleware/flash.rb:260:in call' rack (1.6.1) lib/rack/session/abstract/id.rb:225:incontext'
rack (1.6.1) lib/rack/session/abstract/id.rb:220:in call' actionpack (4.2.1) lib/action_dispatch/middleware/cookies.rb:560:incall'
activerecord (4.2.1) lib/active_record/query_cache.rb:36:in call' activerecord (4.2.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:649:incall'
activerecord (4.2.1) lib/active_record/migration.rb:378:in call' actionpack (4.2.1) lib/action_dispatch/middleware/callbacks.rb:29:inblock in call'
activesupport (4.2.1) lib/active_support/callbacks.rb:88:in call' activesupport (4.2.1) lib/active_support/callbacks.rb:88:in_run_callbacks'
activesupport (4.2.1) lib/active_support/callbacks.rb:776:in _run_call_callbacks' activesupport (4.2.1) lib/active_support/callbacks.rb:81:inrun_callbacks'
actionpack (4.2.1) lib/action_dispatch/middleware/callbacks.rb:27:in call' actionpack (4.2.1) lib/action_dispatch/middleware/reloader.rb:73:incall'
actionpack (4.2.1) lib/action_dispatch/middleware/remote_ip.rb:78:in call' better_errors (2.1.1) lib/better_errors/middleware.rb:59:incall'
actionpack (4.2.1) lib/action_dispatch/middleware/debug_exceptions.rb:17:in call' web-console (2.1.2) lib/web_console/middleware.rb:29:incall'
actionpack (4.2.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in call' railties (4.2.1) lib/rails/rack/logger.rb:38:incall_app'
railties (4.2.1) lib/rails/rack/logger.rb:20:in block in call' activesupport (4.2.1) lib/active_support/tagged_logging.rb:68:inblock in tagged'
activesupport (4.2.1) lib/active_support/tagged_logging.rb:26:in tagged' activesupport (4.2.1) lib/active_support/tagged_logging.rb:68:intagged'
railties (4.2.1) lib/rails/rack/logger.rb:20:in call' actionpack (4.2.1) lib/action_dispatch/middleware/request_id.rb:21:incall'
rack (1.6.1) lib/rack/methodoverride.rb:22:in call' rack (1.6.1) lib/rack/runtime.rb:18:incall'
activesupport (4.2.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in call' rack (1.6.1) lib/rack/lock.rb:17:incall'
actionpack (4.2.1) lib/action_dispatch/middleware/static.rb:113:in call' rack (1.6.1) lib/rack/sendfile.rb:113:incall'
railties (4.2.1) lib/rails/engine.rb:518:in call' railties (4.2.1) lib/rails/application.rb:164:incall'
rack (1.6.1) lib/rack/lock.rb:17:in call' rack (1.6.1) lib/rack/content_length.rb:15:incall'
rack (1.6.1) lib/rack/handler/webrick.rb:89:in service' /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:inservice'
/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:in run' /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:inblock in start_thread'

There is a exactly same issues post here : #10
but I tried their solution, still did not figure out how to make it right. Wish someone can help me! Thank you!

NOMethodError

hi, i'm getting this error on the callback

NoMethodError

undefined method `[]' for nil:NilClass

Rails.root: /home/ubuntu-pc/Workspace/matchup

Not sure why this is causing this, i've used a manual url to catch the callback to my authentications controller create action but nothing happens.

(steam) Authentication failure! invalid_credentials encountered.

I guy i have a probleme with my omniauth-steam.
I think the pb is i use auth to have steam id with a registred user, before the fix off claimed url it will work but no i have this problème
Any one can help me ?
Thanks to u

in my terminal
I, [2018-04-13T11:14:01.392233 #31937] INFO -- OpenID: WARNING: making https request to https://steamcommunity.com/openid without verifying server certificate; no CA path was specified.
I, [2018-04-13T11:14:01.863875 #31937] INFO -- OpenID: WARNING: making https request to https://steamcommunity.com/openid/login without verifying server certificate; no CA path was specified.
I, [2018-04-13T11:14:02.285985 #31937] INFO -- OpenID: Missing required parameter in response from https://steamcommunity.com/openid/login: http://specs.openid.net/auth/2.0assoc_type not in this message
I, [2018-04-13T11:14:02.307495 #31937] INFO -- OpenID: Generated checkid_setup request to https://steamcommunity.com/openid/login using stateless mode.
[...]
[2018-04-13T10:39:06.586316 #28965] INFO -- OpenID: Error attempting to use stored discovery information: OpenID::TypeURIMismatch
I, [2018-04-13T10:39:06.586447 #28965] INFO -- OpenID: Attempting discovery to verify endpoint
I, [2018-04-13T10:39:06.586509 #28965] INFO -- OpenID: Performing discovery on https://steamcommunity.com/openid/id/mon_id
I, [2018-04-13T10:39:06.587035 #28965] INFO -- OpenID: WARNING: making https request to https://steamcommunity.com/openid/id/mon_id without verifying server certificate; no CA path was specified.
I, [2018-04-13T10:39:07.087690 #28965] INFO -- OpenID: Using 'check_authentication' with https://steamcommunity.com/openid/login
I, [2018-04-13T10:39:07.088055 #28965] INFO -- OpenID: WARNING: making https request to https://steamcommunity.com/openid/login without verifying server certificate; no CA path was specified.
(steam) Authentication failure! invalid_credentials encountered
def failure
render plain: params.inspect
end
this show me :
<ActionController::Parameters {} permitted: false>

Devise support

did anybody get Devise + steam running?

i did so far:

initializer

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :steam, "5C101C7DB8B6F018142352D611DE8A6D"
end

telling devise to use :steam

config.omniauth :steam

i then get forwarded to STEAM login page. i login and i get returned, however errors occure


INFO -- omniauth: (steam) Request phase initiated.
INFO -- OpenID: WARNING: making https request to https://steamcommunity.com/openid/login without verifying server certificate; no CA path was specified.
INFO -- OpenID: Missing required parameter in response from https://steamcommunity.com/openid/login: <http://specs.openid.net/auth/2.0>assoc_type not in this message
INFO -- OpenID: Generated checkid_setup request to https://steamcommunity.com/openid/login using stateless mode.


Started GET "/users/auth/steam/callback?_method=post&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.mode=id_res&openid.op_endpoint=https%3A%2F%2Fsteamcommunity.com%2Fopenid%2Flogin&openid.claimed_id=http%3A%2F%2Fsteamcommunity.com%2Fopenid%2Fid%2F76561198253086494&openid.identity=http%3A%2F%2Fsteamcommunity.com%2Fopenid%2Fid%2F76561198253086494&openid.return_to=http%3A%2F%2F192.168.1.3%2Fusers%2Fauth%2Fsteam%2Fcallback%3F_method%3Dpost&openid.response_nonce=2018-02-23T08%3A10%3A13Z0stTyQGY2iMrEpNF5S8qsQSN3gM%3D&openid.assoc_handle=1234567890&openid.signed=signed%2Cop_endpoint%2Cclaimed_id%2Cidentity%2Creturn_to%2Cresponse_nonce%2Cassoc_handle&openid.sig=GaHyK%2BW5r8cCtzMeJuV3zR8tmrY%3D" for 192.168.1.14 at 2018-02-23 15:10:14 +0700

INFO -- omniauth: (steam) Callback phase initiated.
INFO -- OpenID: Error attempting to use stored discovery information: OpenID::TypeURIMismatch
INFO -- OpenID: Attempting discovery to verify endpoint
INFO -- OpenID: Performing discovery on http://steamcommunity.com/openid/id/76561198253086494
INFO -- OpenID: Using 'check_authentication' with https://steamcommunity.com/openid/login
INFO -- OpenID: WARNING: making https request to https://steamcommunity.com/openid/login without verifying server certificate; no CA path was specified.
INFO -- omniauth: (steam) Callback phase initiated.
ERROR -- omniauth: (steam) Authentication failure! invalid_credentials encountered.


Processing by Users::OmniauthCallbacksController#failure as HTML
Redirected to http://192.168.1.3/
Completed 302 Found in 1ms (ActiveRecord: 0.0ms)

i dont know why the invalid_credentials is raised.

Rails 5 current_user is returning NIL

I've been having an issue since I re-tried this gem. I'm noticing that current_user is always being returned as NIL when I try to inact the omniauth-steam function.

I've discussed with multiple other developers, and I can use the exact same function/call for Twitter as I can Steam but Steam will always return 'nil' (Thus not allowing me to properly authorize it against the account).

Has anyone else experienced this, or similar? I see a few mentions from 2015 but no resolutions.

    def steam
        omni = request.env["omniauth.auth"]
        authentication = Authentication.find_by_provider_and_uid(omni['provider'], omni['uid'])
        
        if authentication
            flash[:notice] = "Logged in Successfully"
            sign_in_and_redirect User.find(authentication.user_id)
        elsif current_user # **This is where it should be hitting**
        token = omni['extra']['raw_info'].steamid
        # render :text => request.env["omniauth.auth"].info.to_hash.inspect

        puts token
        token_secret = ""
            
            current_user.authentications.create!(:provider => omni['provider'], 
                                                 :uid => omni['uid'], 
                                                 :token => token, 
                                                 :token_secret => token_secret)
            flash[:notice] = "Authentication successful."
            sign_in_and_redirect current_user
        else
            user = User.new
            user.steam_omni(omni)
        end
        
        if user.save
            flash[:notice] = "Logged in."
            sign_in_and_redirect User.find(user.id)             
        else # **This is where it's actually hitting**
            session[:omniauth] = omni.except('extra')
            redirect_to new_user_registration_path
        end
    end

Getting invalid credentials if I try to login twice in the same session.

Firstly, thanks for the strategy.

I'm getting an OmniAuth::InvalidCredentials error if I login once with steam, then try to do it a second time. To prevent this when I go to /auth/steam I have to click "Not you?" and relogin to prevent the error. Is this a thing you may have heard of? I'll try and get a sample app to reproduce it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.