Соединение с OpenId Steam с помощью Steam OmniAuth gem выдает ошибку" неверные учетные данные".
Я пытаюсь использовать omniauth-steam gem для подключения пользователя через Steam и получения ID64 пользователя. Я запускаю Ruby on Rails 5.0.1, используя сервер в своей локальной сети sporting Apache с Passenger. Всякий раз, когда я пытаюсь подключиться к /auth/steam, я перенаправляюсь на веб-страницу Steam с помощью кнопки "подключиться" (я уже вошел в систему). При нажатии на кнопку я получаю страницу ошибки с сообщением "invalid_credentials". Я зарегистрировался в Steam и могу просматривать сайт без регистрации. проблема. Откуда приходит это сообщение? Как я могу это исправить? Вот мой код на данный момент.
Инициализатор Omniauth :
# config/initializers/omniauth.rb
Rails.application.config.middleware.use OmniAuth::Builder do
provider :steam, Rails.application.secrets.steam_web_api_key
end
Контроллер :
skip_before_filter :verify_authenticity_token, :only => :auth_callback
def index
end
def auth_callback
auth = request.env['omniauth.auth']
session[:current_user] = {
:nickname => auth.info['nickname'],
:image => auth.info['image'],
:uid => auth.uid
}
redirect_to root_url
end
Вид :
<p><%= link_to image_tag("http://cdn.steamcommunity.com/public/images/signinthroughsteam/sits_large_noborder.png"), '/auth/steam' %></p>
Маршруты :
get 'admin/index'
post 'auth/steam/callback' => 'admin#auth_callback'
root 'admin#index'
Стек ошибок :
invalid_credentials
Extracted source (around line #25):
23 def raise_out!
24 fail(env['omniauth.error'] || OmniAuth::Error.new(env['omniauth.error.type']))
25
26 end
27
28 def redirect_to_failure
omniauth (1.3.1) lib/omniauth/failure_endpoint.rb:25:in `raise_out!'
omniauth (1.3.1) lib/omniauth/failure_endpoint.rb:20:in `call'
omniauth (1.3.1) lib/omniauth/failure_endpoint.rb:12:in `call'
omniauth (1.3.1) lib/omniauth/strategy.rb:479:in `fail!'
omniauth-openid (1.0.1) lib/omniauth/strategies/open_id.rb:80:in `callback_phase'
omniauth (1.3.1) lib/omniauth/strategy.rb:227:in `callback_call'
omniauth (1.3.1) lib/omniauth/strategy.rb:184:in `call!'
omniauth (1.3.1) lib/omniauth/strategy.rb:164:in `call'
omniauth (1.3.1) lib/omniauth/builder.rb:63:in `call'
rack (2.0.1) lib/rack/etag.rb:25:in `call'
rack (2.0.1) lib/rack/conditional_get.rb:25:in `call'
rack (2.0.1) lib/rack/head.rb:12:in `call'
rack (2.0.1) lib/rack/session/abstract/id.rb:222:in `context'
rack (2.0.1) lib/rack/session/abstract/id.rb:216:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/cookies.rb:613:in `call'
activerecord (5.0.1) lib/active_record/migration.rb:553:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/callbacks.rb:38:in `block in call'
activesupport (5.0.1) lib/active_support/callbacks.rb:97:in `__run_callbacks__'
activesupport (5.0.1) lib/active_support/callbacks.rb:750:in `_run_call_callbacks'
activesupport (5.0.1) lib/active_support/callbacks.rb:90:in `run_callbacks'
actionpack (5.0.1) lib/action_dispatch/middleware/callbacks.rb:36:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call'
web-console (3.4.0) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.4.0) lib/web_console/middleware.rb:20:in `block in call'
web-console (3.4.0) lib/web_console/middleware.rb:18:in `catch'
web-console (3.4.0) lib/web_console/middleware.rb:18:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.0.1) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.0.1) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.0.1) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.0.1) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.0.1) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.0.1) lib/rails/rack/logger.rb:24:in `call'
sprockets-rails (3.2.0) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/request_id.rb:24:in `call'
rack (2.0.1) lib/rack/method_override.rb:22:in `call'
rack (2.0.1) lib/rack/runtime.rb:22:in `call'
activesupport (5.0.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/static.rb:136:in `call'
rack (2.0.1) lib/rack/sendfile.rb:111:in `call'
railties (5.0.1) lib/rails/engine.rb:522:in `call'
/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:97:in `process_request'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:152:in `accept_and_process_next_request'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:113:in `main_loop'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:416:in `block (3 levels) in start_threads'
/usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:113:in `block in create_thread_and_abort_on_exception'