jbbarth / redmine_omniauth_cas

CAS authentication plugin for Redmine through OmniAuth
MIT License
20 stars 14 forks source link

Internal error during CAS auth #1

Open bggo opened 12 years ago

bggo commented 12 years ago

hello,

I just upgrade from redmine1.x were I use to have the redmine-cas-plugin. As I installed redmine 2.x and you plugin ins compatible I tried to configure it, but without sucess. Do you have any ideia what's heppening?

When I enter in redmine and click on "Login with CAS" i'm redirected to my CAS login page where I provide my right credentias em get the ticket id. But in the return of CAS to redmine something went wrong ....

A get those logs . . .

Started GET "/" for 10.110.129.41 at Wed Oct 31 09:36:13 -0200 2012 Processing by WelcomeController#index as HTML Current user: anonymous Redirected to http://redmine.ir7.com.br/login?back_url=http%3A%2F%2Fredmine.ir7.com.br%2F Filter chain halted as :check_if_login_required rendered or redirected Completed 302 Found in 4ms (ActiveRecord: 0.6ms)

Started GET "/login?back_url=http%3A%2F%2Fredmine.ir7.com.br%2F" for 10.110.129.41 at Wed Oct 31 09:36:13 -0200 2012 Processing by AccountController#login as HTML Parameters: {"back_url"=>"http://redmine.ir7.com.br/"} Current user: anonymous Rendered plugins/redmine_omniauth_cas/app/views/redmine_omniauth_cas/_view_account_login_top.html.erb (1.3ms) Rendered account/login.html.erb within layouts/base (4.9ms) Completed 200 OK in 11ms (Views: 8.1ms | ActiveRecord: 1.0ms)

Started GET "/auth/cas/callback?url=http%3A%2F%2Fredmine.ir7.com.br%2Flogin%3Fback_url%3Dhttp%253A%252F%252Fredmine.ir7.com.br%252F&ticket=ST-1360-Yx3e6sL5QXI9i7deunw3-cas" for 10.110.129.41 at Wed Oct 31 09:36:22 -0200 2012

Errno::ECONNREFUSED (Connection refused - connect(2)): /usr/lib/ruby/1.8/net/http.rb:560:in initialize' /usr/lib/ruby/1.8/net/http.rb:560:inopen' /usr/lib/ruby/1.8/net/http.rb:560:in connect' /usr/lib/ruby/1.8/timeout.rb:53:intimeout' /usr/lib/ruby/1.8/timeout.rb:101:in timeout' /usr/lib/ruby/1.8/net/http.rb:560:inconnect' /usr/lib/ruby/1.8/net/http.rb:553:in do_start' /usr/lib/ruby/1.8/net/http.rb:542:instart' omniauth-cas (0.0.7) lib/omniauth/strategies/cas/service_ticket_validator.rb:85:in get_service_response_body' omniauth-cas (0.0.7) lib/omniauth/strategies/cas/service_ticket_validator.rb:32:inuser_info' omniauth-cas (0.0.7) lib/omniauth/strategies/cas.rb:67:in callback_phase' omniauth (1.1.1) lib/omniauth/strategy.rb:219:incallback_call' omniauth (1.1.1) lib/omniauth/strategy.rb:175:in call!' omniauth (1.1.1) lib/omniauth/strategy.rb:157:incall' omniauth (1.1.1) lib/omniauth/builder.rb:48:in call' rack-openid (1.3.1) lib/rack/openid.rb:98:incall' actionpack (3.2.8) lib/action_dispatch/middleware/best_standards_support.rb:17:in call' rack (1.4.1) lib/rack/etag.rb:23:incall' rack (1.4.1) lib/rack/conditionalget.rb:25:in call' actionpack (3.2.8) lib/action_dispatch/middleware/head.rb:14:incall' actionpack (3.2.8) lib/action_dispatch/middleware/params_parser.rb:21:in call' actionpack (3.2.8) lib/action_dispatch/middleware/flash.rb:242:incall' rack (1.4.1) lib/rack/session/abstract/id.rb:205:in context' rack (1.4.1) lib/rack/session/abstract/id.rb:200:incall' actionpack (3.2.8) lib/action_dispatch/middleware/cookies.rb:339:in call' activerecord (3.2.8) lib/active_record/query_cache.rb:64:incall' activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in call' actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:28:incall' activesupport (3.2.8) lib/active_support/callbacks.rb:405:in _run__120397005__call__4__callbacks' activesupport (3.2.8) lib/active_support/callbacks.rb:405:insend' activesupport (3.2.8) lib/active_support/callbacks.rb:405:in __run_callback' activesupport (3.2.8) lib/active_support/callbacks.rb:385:in_run_call_callbacks' activesupport (3.2.8) lib/active_support/callbacks.rb:81:in send' activesupport (3.2.8) lib/active_support/callbacks.rb:81:inrun_callbacks' actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:27:in call' actionpack (3.2.8) lib/action_dispatch/middleware/remote_ip.rb:31:incall' actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:16:in call' actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:incall' railties (3.2.8) lib/rails/rack/logger.rb:26:in call_app' railties (3.2.8) lib/rails/rack/logger.rb:16:incall' actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:in call' rack (1.4.1) lib/rack/methodoverride.rb:21:incall' rack (1.4.1) lib/rack/runtime.rb:17:in call' activesupport (3.2.8) lib/active_support/cache/strategy/local_cache.rb:72:incall' rack (1.4.1) lib/rack/lock.rb:15:in call' actionpack (3.2.8) lib/action_dispatch/middleware/static.rb:62:incall' rack-cache (1.2) lib/rack/cache/context.rb:136:in forward' rack-cache (1.2) lib/rack/cache/context.rb:245:infetch' rack-cache (1.2) lib/rack/cache/context.rb:185:in lookup' rack-cache (1.2) lib/rack/cache/context.rb:66:incall!' rack-cache (1.2) lib/rack/cache/context.rb:51:in call' railties (3.2.8) lib/rails/engine.rb:479:incall' railties (3.2.8) lib/rails/application.rb:223:in call' rack (1.4.1) lib/rack/content_length.rb:14:incall' rack (1.4.1) lib/rack/handler/webrick.rb:59:in service' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:inservice' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in run' /usr/lib/ruby/1.8/webrick/server.rb:173:instart_thread' /usr/lib/ruby/1.8/webrick/server.rb:162:in start' /usr/lib/ruby/1.8/webrick/server.rb:162:instart_thread' /usr/lib/ruby/1.8/webrick/server.rb:95:in start' /usr/lib/ruby/1.8/webrick/server.rb:92:ineach' /usr/lib/ruby/1.8/webrick/server.rb:92:in start' /usr/lib/ruby/1.8/webrick/server.rb:23:instart' /usr/lib/ruby/1.8/webrick/server.rb:82:in start' rack (1.4.1) lib/rack/handler/webrick.rb:13:inrun' rack (1.4.1) lib/rack/server.rb:265:in start' railties (3.2.8) lib/rails/commands/server.rb:70:instart' railties (3.2.8) lib/rails/commands.rb:55 railties (3.2.8) lib/rails/commands.rb:50:in tap' railties (3.2.8) lib/rails/commands.rb:50 script/rails:6:inrequire' script/rails:6

Any Ideias?

Kind Regards

jbbarth commented 11 years ago

First sorry for the late anwser..

Errno::ECONNREFUSED (Connection refused - connect(2)): make me think your redmine instance cannot connect to the CAS server for ticket validation. In some cases (mine for instance), ticket validation is done through an internal (intranet) URL while users fill in the form on Internet, that's why there are 2 settings in the plugin configuration. Maybe one of these settings is misconfigured.

If this is not the case, the easiest way to debug it is edit /usr/lib/ruby/1.8/net/http.rb line 560 and output a debug line to see where the lib is actually trying to connect to. It might seem ugly but it saved me a dozen times with this plugin, and I don't really have a better solution since it's not my plugin but an external gem (omniauth-cas) that handle the CAS dialog.

Hope this helps, and sorry again I missed your ticket.

jbbarth commented 11 years ago

OK, I found a stupid error on my side when you leave the second parameter blank. It resulted exactly in the error message you got, and I think it's fixed in lastest commits. Could you give it a try and tell me if things are better ? Thanks

bggo commented 11 years ago

Hey thanks for the reply. As soon as possible I'll make some tests on this. Kind Regards