SUSE / Portus

Authorization service and frontend for Docker registry (v2)
http://port.us.org/
Apache License 2.0
3k stars 471 forks source link

User account creation with openid-connect throws CookieOverflow #2282

Closed Josua-SR closed 3 years ago

Josua-SR commented 4 years ago

Description

First login - aka User Account Creation - with openid-connect causes ActionDispatch::Cookies::CookieOverflow.

Steps to reproduce

  1. Deploy Portus with openid-connect oauth provider, e.g. keycloak
  2. Go to openid-connect login page, e.g. https://portus/users/auth/openid_connect
  3. Proceed with login at the openid-connect provider
  4. Get redirected to https://portus/users/oauth
Started GET "/users/auth/openid_connect" for 2003:c6:1f43:a610::f30 at 2020-02-06 15:20:10 +0000
I, [2020-02-06T15:20:10.130847 #69]  INFO -- omniauth: (openid_connect) Setup endpoint detected, running now.
I, [2020-02-06T15:20:10.132324 #69]  INFO -- omniauth: (openid_connect) Request phase initiated.
Started GET "/users/auth/openid_connect/callback?state=hidden&session_state=hidden&code=hidden" for 2003:c6:1f43:a610::f30 at 2020-02-06 15:20:16 +0000
I, [2020-02-06T15:20:16.440949 #69]  INFO -- omniauth: (openid_connect) Setup endpoint detected, running now.
I, [2020-02-06T15:20:16.442139 #69]  INFO -- omniauth: (openid_connect) Callback phase initiated.
Processing by Auth::OmniauthCallbacksController#openid_connect as HTML
  Parameters: {"state"=>"hidden", "session_state"=>"hidden", "code"=>"hidden"}
Redirected to https://portus/users/oauth
Filter chain halted as :check_user rendered or redirected
Completed 302 Found in 123ms (ActiveRecord: 55.2ms)

ActionDispatch::Cookies::CookieOverflow (ActionDispatch::Cookies::CookieOverflow):

vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/cookies.rb:649:in `commit'
vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/cookies.rb:484:in `[]='
vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/session/cookie_store.rb:106:in `set_cookie'
vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/session/abstract/id.rb:363:in `commit_session'
vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/session/abstract/id.rb:234:in `context'
vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/session/abstract/id.rb:226:in `call'
vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/cookies.rb:670:in `call'
vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:98:in `run_callbacks'
vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call'
vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/rack/logger.rb:38:in `call_app'
vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/rack/logger.rb:26:in `block in call'
vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/tagged_logging.rb:71:in `block in tagged'
vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/tagged_logging.rb:28:in `tagged'
vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/tagged_logging.rb:71:in `tagged'
vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/rack/logger.rb:26:in `call'
vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/request_id.rb:27:in `call'
vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/method_override.rb:22:in `call'
vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/runtime.rb:22:in `call'
vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/executor.rb:14:in `call'
vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/static.rb:127:in `call'
vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/sendfile.rb:111:in `call'
vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:524:in `call'
vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/urlmap.rb:68:in `block in call'
vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/urlmap.rb:53:in `each'
vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/urlmap.rb:53:in `call'
vendor/bundle/ruby/2.6.0/gems/puma-3.12.1/lib/puma/configuration.rb:227:in `call'
vendor/bundle/ruby/2.6.0/gems/puma-3.12.1/lib/puma/server.rb:660:in `handle_request'
vendor/bundle/ruby/2.6.0/gems/puma-3.12.1/lib/puma/server.rb:474:in `process_client'
vendor/bundle/ruby/2.6.0/gems/puma-3.12.1/lib/puma/server.rb:334:in `block in run'
vendor/bundle/ruby/2.6.0/gems/puma-3.12.1/lib/puma/thread_pool.rb:135:in `block in spawn_thread'
Processing by ErrorsController#show as HTML
  Parameters: {"state"=>"hidden", "session_state"=>"hidden", "code"=>"hidden", "status"=>"500"}
  Rendering errors/500.html.erb within layouts/errors
  Rendered errors/500.html.erb within layouts/errors (2.5ms)
  Rendered errors/_status_title.html.slim (6.5ms)
Completed 500 Internal Server Error in 49ms (Views: 46.5ms | ActiveRecord: 0.0ms)

Deployment information

Deployment method:

Kubernetes, with custom patches that are part of other Pull Requests.

stale[bot] commented 4 years ago

Thanks for all your contributions! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Josua-SR commented 4 years ago

/unstale

luckyf commented 4 years ago

Hi @Josua-SR , could you may share your configuration for enabling OpenId Connect? I'm currently trying to get it running but it seems like staying deactivated with my config.

stale[bot] commented 3 years ago

Thanks for all your contributions! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.