Hi Paolo,

I am also trying to authenticate my Gitlab via Jira (no Crowd).
Tried multiple stuff but still not positive result.
Will it possible for you to put up a step-by-step blog about how you made 
it working.
It would be a great help to me and the community.

Thanks

On Wednesday, May 7, 2014 at 9:34:33 AM UTC+5:30, Paolo Alexis Falcone 
wrote:
>
> Managed to solve this problem by doing the following modifications:
>
>
>    1. Removed the 'jira' entry in the "providers" section in 
>    config/gitlab.yml. Apparently providers that are to be specified there use 
>    consumer key + consumer secret combination, which does not work with 
>    omniauth-jira (as the message digest it uses is RSA-SHA1)
>    2. Monkey-patch omniauth-jira as by default JIRA exports empty 
>    username and email address entries.
>    3. Modified the following files:
>
>           in config/initializers/devise.rb
>
>           config.omniauth :jira,
>             'MY_APP_ID',
>             '',
>             client_options: {
>               site: 'https://jira.example.com',
>               private_key_file: '/path/to/private.key'
>             }
>
>           in app/controllers/omniauth_callbacks_controller.rb:
>
>           def jira
>             handle_omniauth
>           end
>
>     
>
> On Friday, May 2, 2014 6:43:48 PM UTC+8, Paolo Alexis Falcone wrote:
>>
>> Has anyone managed to get GitLab authenticate to a JIRA server via OAuth?
>>
>> I've started configuring GitLab 6.8 to authenticate against a JIRA 4.4 
>> server using the omniauth-jira 
>> <https://github.com/snikulin/omniauth-jira> gem:
>>
>> in config/gitlab.yml:
>>
>>     providers:
>>       - { name: 'jira' }
>>
>> in config/application.yml:
>>
>>     config.middleware.use OmniAuth::Builder do
>>       provider 'jira', 'MY_APP_ID', '', :client_options => { :site => '
>> https://jira.example.com', :private_key_file => "/path/to/private.key" }
>>     end
>>
>> The callback part fails though and an error 500 is issued:
>>
>> TypeError (can't convert nil into String):
>>   
>> vendor/bundle/ruby/1.9.1/gems/oauth-0.4.7/lib/oauth/signature/rsa/sha1.rb:35:in
>>  
>> `initialize'
>>   
>> vendor/bundle/ruby/1.9.1/gems/oauth-0.4.7/lib/oauth/signature/rsa/sha1.rb:35:in
>>  
>> `new'
>>   
>> vendor/bundle/ruby/1.9.1/gems/oauth-0.4.7/lib/oauth/signature/rsa/sha1.rb:35:in
>>  
>> `digest'
>>   
>> vendor/bundle/ruby/1.9.1/gems/oauth-0.4.7/lib/oauth/signature/base.rb:65:in 
>> `signature'
>>   vendor/bundle/ruby/1.9.1/gems/oauth-0.4.7/lib/oauth/signature.rb:23:in 
>> `sign'
>>   
>> vendor/bundle/ruby/1.9.1/gems/oauth-0.4.7/lib/oauth/client/helper.rb:45:in 
>> `signature'
>>   
>> vendor/bundle/ruby/1.9.1/gems/oauth-0.4.7/lib/oauth/client/helper.rb:75:in 
>> `header'
>>   
>> vendor/bundle/ruby/1.9.1/gems/oauth-0.4.7/lib/oauth/client/net_http.rb:91:in 
>> `set_oauth_header'
>>   
>> vendor/bundle/ruby/1.9.1/gems/oauth-0.4.7/lib/oauth/client/net_http.rb:30:in 
>> `oauth!'
>>   vendor/bundle/ruby/1.9.1/gems/oauth-0.4.7/lib/oauth/consumer.rb:224:in 
>> `sign!'
>>   vendor/bundle/ruby/1.9.1/gems/oauth-0.4.7/lib/oauth/consumer.rb:188:in 
>> `create_signed_request'
>>   vendor/bundle/ruby/1.9.1/gems/oauth-0.4.7/lib/oauth/consumer.rb:159:in 
>> `request'
>>   vendor/bundle/ruby/1.9.1/gems/oauth-0.4.7/lib/oauth/consumer.rb:194:in 
>> `token_request'
>>   
>> vendor/bundle/ruby/1.9.1/gems/oauth-0.4.7/lib/oauth/tokens/request_token.rb:18:in
>>  
>> `get_access_token'
>>   
>> vendor/bundle/ruby/1.9.1/gems/omniauth-oauth-1.0.1/lib/omniauth/strategies/oauth.rb:57:in
>>  
>> `callback_phase'
>>   
>> vendor/bundle/ruby/1.9.1/gems/omniauth-1.1.4/lib/omniauth/strategy.rb:226:in 
>> `callback_call'
>>   
>> vendor/bundle/ruby/1.9.1/gems/omniauth-1.1.4/lib/omniauth/strategy.rb:182:in 
>> `call!'
>>   
>> vendor/bundle/ruby/1.9.1/gems/omniauth-1.1.4/lib/omniauth/strategy.rb:164:in 
>> `call'
>>   vendor/bundle/ruby/1.9.1/gems/rack-cors-0.2.9/lib/rack/cors.rb:54:in 
>> `call'
>>   
>> vendor/bundle/ruby/1.9.1/gems/omniauth-1.1.4/lib/omniauth/strategy.rb:401:in 
>> `call_app!'
>>   
>> vendor/bundle/ruby/1.9.1/gems/omniauth-1.1.4/lib/omniauth/strategy.rb:363:in 
>> `callback_phase'
>>   
>> vendor/bundle/ruby/1.9.1/gems/omniauth-oauth-1.0.1/lib/omniauth/strategies/oauth.rb:58:in
>>  
>> `callback_phase'
>>   
>> vendor/bundle/ruby/1.9.1/gems/omniauth-1.1.4/lib/omniauth/strategy.rb:226:in 
>> `callback_call'
>>   
>> vendor/bundle/ruby/1.9.1/gems/omniauth-1.1.4/lib/omniauth/strategy.rb:182:in 
>> `call!'
>>   
>> vendor/bundle/ruby/1.9.1/gems/omniauth-1.1.4/lib/omniauth/strategy.rb:164:in 
>> `call'
>>   
>> vendor/bundle/ruby/1.9.1/gems/omniauth-1.1.4/lib/omniauth/builder.rb:49:in 
>> `call'
>>   
>> vendor/bundle/ruby/1.9.1/gems/rack-attack-2.3.0/lib/rack/attack.rb:63:in 
>> `call'
>>   vendor/bundle/ruby/1.9.1/gems/warden-1.2.3/lib/warden/manager.rb:35:in 
>> `block in call'
>>   vendor/bundle/ruby/1.9.1/gems/warden-1.2.3/lib/warden/manager.rb:34:in 
>> `catch'
>>   vendor/bundle/ruby/1.9.1/gems/warden-1.2.3/lib/warden/manager.rb:34:in 
>> `call'
>>   vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/etag.rb:23:in `call'
>>   
>> vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/conditionalget.rb:25:in 
>> `call'
>>   vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
>>   
>> vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.3/lib/action_dispatch/middleware/params_parser.rb:27:in
>>  
>> `call'
>>   
>> vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.3/lib/action_dispatch/middleware/flash.rb:241:in
>>  
>> `call'
>>   
>> vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in
>>  
>> `context'
>>   
>> vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in
>>  
>> `call'
>>   
>> vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.3/lib/action_dispatch/middleware/cookies.rb:486:in
>>  
>> `call'
>>   
>> vendor/bundle/ruby/1.9.1/gems/activerecord-4.0.3/lib/active_record/query_cache.rb:36:in
>>  
>> `call'
>>   
>> vendor/bundle/ruby/1.9.1/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in
>>  
>> `call'
>>   
>> vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.3/lib/action_dispatch/middleware/callbacks.rb:29:in
>>  
>> `block in call'
>>   
>> vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.3/lib/active_support/callbacks.rb:373:in
>>  
>> `_run__3118028535583330693__call__callbacks'
>>   
>> vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.3/lib/active_support/callbacks.rb:80:in
>>  
>> `run_callbacks'
>>   
>> vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.3/lib/action_dispatch/middleware/callbacks.rb:27:in
>>  
>> `call'
>>   
>> vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.3/lib/action_dispatch/middleware/remote_ip.rb:76:in
>>  
>> `call'
>>   
>> vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.3/lib/action_dispatch/middleware/debug_exceptions.rb:17:in
>>  
>> `call'
>>   
>> vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.3/lib/action_dispatch/middleware/show_exceptions.rb:30:in
>>  
>> `call'
>>   
>> vendor/bundle/ruby/1.9.1/gems/railties-4.0.3/lib/rails/rack/logger.rb:38:in 
>> `call_app'
>>   
>> vendor/bundle/ruby/1.9.1/gems/railties-4.0.3/lib/rails/rack/logger.rb:20:in 
>> `block in call'
>>   
>> vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.3/lib/active_support/tagged_logging.rb:67:in
>>  
>> `block in tagged'
>>   
>> vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.3/lib/active_support/tagged_logging.rb:25:in
>>  
>> `tagged'
>>   
>> vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.3/lib/active_support/tagged_logging.rb:67:in
>>  
>> `tagged'
>>   
>> vendor/bundle/ruby/1.9.1/gems/railties-4.0.3/lib/rails/rack/logger.rb:20:in 
>> `call'
>>   
>> vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.3/lib/action_dispatch/middleware/request_id.rb:21:in
>>  
>> `call'
>>   
>> vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in 
>> `call'
>>   vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/runtime.rb:17:in 
>> `call'
>>   vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
>>   vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in 
>> `call'
>>   vendor/bundle/ruby/1.9.1/gems/railties-4.0.3/lib/rails/engine.rb:511:in 
>> `call'
>>   
>> vendor/bundle/ruby/1.9.1/gems/railties-4.0.3/lib/rails/application.rb:97:in 
>> `call'
>>   
>> vendor/bundle/ruby/1.9.1/gems/railties-4.0.3/lib/rails/railtie/configurable.rb:30:in
>>  
>> `method_missing'
>>   vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:138:in 
>> `call'
>>   vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/urlmap.rb:65:in 
>> `block in call'
>>   vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in `each'
>>   vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in `call'
>>   passenger (4.0.40) 
>> lib/phusion_passenger/rack/thread_handler_extension.rb:74:in 
>> `process_request'
>>   passenger (4.0.40) 
>> lib/phusion_passenger/request_handler/thread_handler.rb:141:in 
>> `accept_and_process_next_request'
>>   passenger (4.0.40) 
>> lib/phusion_passenger/request_handler/thread_handler.rb:109:in `main_loop'
>>   passenger (4.0.40) lib/phusion_passenger/request_handler.rb:448:in 
>> `block (3 levels) in start_threads'
>>
>>  
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"GitLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to gitlabhq+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/gitlabhq/429161c3-9592-46e7-9ae0-c56326a56ec9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to