robdimarco / omniauth_crowd

An OmniAuth provider for Atlassian Crowd REST API
MIT License
30 stars 21 forks source link

not working with omniauth 1.1.4 ? #12

Closed hudecof closed 10 years ago

hudecof commented 11 years ago

Hi,

I tried to setup the crowd provider for gitlab project. It will not pass the object construction, so the initialize method has wrong number of parameters. Is the 2.1.1 version compatible with the 1.1.4 of the omniauth?

root@source:/home/phudec# gem list | grep omni
gitlab_omniauth-ldap (1.0.3)
omniauth (1.1.4)
omniauth-github (1.1.1)
omniauth-google-oauth2 (0.2.0)
omniauth-oauth (1.0.1)
omniauth-oauth2 (1.1.1)
omniauth-twitter (1.0.0)
omniauth_crowd (2.1.1)
robdimarco commented 11 years ago

I have not tested with omniauth 1.1 yet.

Do you have a stacktrace you can attach to this issue?

robdimarco commented 11 years ago

I have tried it out with omniauth 1.1.4 and have had no problems. Can you give me more details (stacktrace/failing unit test) that illustrates the problem?

hudecof commented 11 years ago

Next 2 weeks staring today I'm out of office. I will attach the traces. The problem is in argument count. Maybe ot' a bug related to the gitlab project and the devise odr maybe wrong configuration.

robdimarco commented 11 years ago

Sorry, accidental close.

robdimarco commented 11 years ago

Just wanted to ping on this again and see if you have traces.

hudecof commented 11 years ago

Still on vacation ;(

On 8/14/13 3:40 AM, Rob Di Marco wrote:

Just wanted to ping on this again and see if you have traces.

— Reply to this email directly or view it on GitHub https://github.com/robdimarco/omniauth_crowd/issues/12#issuecomment-22610128.

hudecof commented 11 years ago

This is my error form the gitlab. As I wrote, meybe my configuration is wrong

==> ../log/sidekiq.log <==
wrong number of arguments (3 for 1..2)
/usr/local/lib/ruby/gems/2.0.0/gems/omniauth_crowd-2.1.1/lib/omniauth/strategies/crowd.rb:10:in `initialize'
/usr/local/lib/ruby/gems/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:43:in `new'
/usr/local/lib/ruby/gems/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:43:in `build'
/usr/local/lib/ruby/gems/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:113:in `block in build'
/usr/local/lib/ruby/gems/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:113:in `each'
/usr/local/lib/ruby/gems/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:113:in `inject'
/usr/local/lib/ruby/gems/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:113:in `build'
/usr/local/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:470:in `app'
/usr/local/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/application/finisher.rb:31:in `block in <module:Finisher>'
/usr/local/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
/usr/local/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
/usr/local/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
/usr/local/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
/usr/local/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
/usr/local/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
/usr/local/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/git/gitlab/config/environment.rb:5:in `<top (required)>'
/usr/local/lib/ruby/gems/2.0.0/gems/sidekiq-2.13.0/lib/sidekiq/cli.rb:195:in `require'
/usr/local/lib/ruby/gems/2.0.0/gems/sidekiq-2.13.0/lib/sidekiq/cli.rb:195:in `boot_system'
/usr/local/lib/ruby/gems/2.0.0/gems/sidekiq-2.13.0/lib/sidekiq/cli.rb:39:in `parse'
/usr/local/lib/ruby/gems/2.0.0/gems/sidekiq-2.13.0/bin/sidekiq:7:in `<top (required)>'
/usr/local/bin/sidekiq:23:in `load'
/usr/local/bin/sidekiq:23:in `<main>'
robdimarco commented 11 years ago

OK, can you show me how you are initializing the crowd provider. It should be something like:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :crowd, :crowd_server_url=>"https://crowd.mycompanyname.com/crowd", :application_name=>"app", :application_password=>"password"
end
hudecof commented 11 years ago

I want to integrate in into gitlab application. The confguration is a litlle bit different. gitlab is using DEVISE. I followed the configuration on the https://github.com/gitlabhq/gitlab-public-wiki/wiki/Working-Custom-Omniauth-Provider-Configurations, "Working CAS Configuration". Of course I changed all relevant parameters.

robdimarco commented 11 years ago

Is there someplace you are trying to instantiate a Omniauth::Strategies::Crowd instance? The bug is that it is trying to pass in 3 arguments in to the constructor and only 1 or 2 are allowed. Any info you can give me on how you are setting up the crowd service would help me debug.

hudecof commented 11 years ago

no I did not. The devise should do it. And there is probably the problem. Devise is passing more parameters to the Crowd module.

hudecof commented 10 years ago

the problem was not in this module. I needed to change the gitlab sources ;(

hudecof commented 10 years ago

I wrote a small blog how to intergrate gitlab with crowd: http://blog.hudecof.net/posts/2014/01/08/gitlab-with-atlassian-crowd.html