Skip to content

Use non-static login path - #4169

Merged
crohr merged 6 commits into
opf:release/5.0from
oliverguenther:fix/login-path
Feb 25, 2016
Merged

crohr merged 6 commits into
opf:release/5.0from
oliverguenther:fix/login-path

Conversation

@oliverguenther

Copy link
Copy Markdown
Member

/cc @crohr

@TeatroIO

Copy link
Copy Markdown

I've prepared a stage to preview changes. Open stage or view logs.

@crohr

crohr commented Feb 19, 2016

Copy link
Copy Markdown
Member

Thanks for that, however now that the login url is correct (e.g. /openproject/login, the next redirection goes to /auth/sso instead of /openproject/auth/sso. Could you have a look as well?

This does solve the relative root url problem with the provider, but
fails due to omniauth/omniauth#767.
@crohr

crohr commented Feb 19, 2016

Copy link
Copy Markdown
Member

After patching omniauth with your fix, and openproject with that PR, I get the follofing:

I, [2016-02-19T15:43:22.687341 #21103]  INFO -- : Started GET "/openproject/login" for 52.29.160.234 at 2016-02-19 15:43:22 +0000
I, [2016-02-19T15:43:22.694618 #21103]  INFO -- : Processing by AccountController#login as HTML
I, [2016-02-19T15:43:22.700298 #21103]  INFO -- : Redirected to https://ucs-2049.openproject.intranet/openproject/auth/sso
I, [2016-02-19T15:43:22.700529 #21103]  INFO -- : Completed 302 Found in 6ms (ActiveRecord: 0.3ms)
I, [2016-02-19T15:43:22.761090 #21103]  INFO -- : Started GET "/openproject/auth/sso" for 52.29.160.234 at 2016-02-19 15:43:22 +0000
F, [2016-02-19T15:43:23.411132 #21103] FATAL -- : 
ActionController::RoutingError (No route matches [GET] "/auth/sso"):
  vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  vendor/bundle/ruby/2.1.0/gems/railties-4.2.5.1/lib/rails/rack/logger.rb:38:in `call_app'
  vendor/bundle/ruby/2.1.0/gems/railties-4.2.5.1/lib/rails/rack/logger.rb:20:in `block in call'
  vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.5.1/lib/active_support/tagged_logging.rb:68:in `block in tagged'
  vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.5.1/lib/active_support/tagged_logging.rb:26:in `tagged'
  vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.5.1/lib/active_support/tagged_logging.rb:68:in `tagged'
  vendor/bundle/ruby/2.1.0/gems/railties-4.2.5.1/lib/rails/rack/logger.rb:20:in `call'
  vendor/bundle/ruby/2.1.0/gems/request_store-1.1.0/lib/request_store/middleware.rb:8:in `call'
  vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/request_id.rb:21:in `call'
  vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/methodoverride.rb:22:in `call'
  vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/runtime.rb:18:in `call'
  vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.5.1/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
  vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/static.rb:116:in `call'
  vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/sendfile.rb:113:in `call'
  vendor/bundle/ruby/2.1.0/gems/railties-4.2.5.1/lib/rails/engine.rb:518:in `call'
  vendor/bundle/ruby/2.1.0/gems/railties-4.2.5.1/lib/rails/application.rb:165:in `call'
  vendor/bundle/ruby/2.1.0/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:in `public_send'
  vendor/bundle/ruby/2.1.0/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:in `method_missing'
  vendor/ruby-2.1.6/lib/ruby/gems/2.1.0/bundler/gems/rack-protection-5a7d1bd2f05c/lib/rack/protection/frame_options.rb:31:in `call'
  vendor/ruby-2.1.6/lib/ruby/gems/2.1.0/bundler/gems/rack-protection-5a7d1bd2f05c/lib/rack/protection/json_csrf.rb:18:in `call'
  vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/urlmap.rb:66:in `block in call'
  vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/urlmap.rb:50:in `each'
  vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/urlmap.rb:50:in `call'
  vendor/bundle/ruby/2.1.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:580:in `process_client'
  vendor/bundle/ruby/2.1.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:674:in `worker_loop'
  vendor/bundle/ruby/2.1.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:529:in `spawn_missing_workers'
  vendor/bundle/ruby/2.1.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:140:in `start'
  vendor/bundle/ruby/2.1.0/gems/unicorn-4.9.0/bin/unicorn:126:in `<top (required)>'
  vendor/bundle/bin/unicorn:16:in `load'
  vendor/bundle/bin/unicorn:16:in `<main>'

@oliverguenther

Copy link
Copy Markdown
Member Author

Weird, It worked with the developer strategy provider. I'll have another look.

@oliverguenther

Copy link
Copy Markdown
Member Author

Did you manually set the request or callback path in the provider configuration? My fix for omniauth doesn't include prefixing the relative url root in that case.

Fixes the specs by overriding the configuration value, not the concern.
Also adds helpers for Setting and OpenProject::Configuration to override
their hashes for accessing values. `:with_config`, `:with_settings`.
@crohr

crohr commented Feb 24, 2016

Copy link
Copy Markdown
Member

@oliverguenther I didn't manually set the request or callback path. But I'll re-test from scratch and let you know.

@crohr

crohr commented Feb 24, 2016

Copy link
Copy Markdown
Member

@oliverguenther unfortunately I'm still getting the error, even after taking the latest release/5.0. My branch is at opf/openproject-ce#6 (this includes the saml plugin).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants