suer / omniauth-redmine Goto Github PK
View Code? Open in Web Editor NEWStrategy to authenticate with Redmine via OAuth in Redmine
License: MIT License
Strategy to authenticate with Redmine via OAuth in Redmine
License: MIT License
I'm getting a 500 error when the callback url is being opened.
I have succesfully installed the redmine_oauth_provider on Redmine and created a new app.
I have then added the omniauth-redmine gem to GitLab, configured the config/gitlab.yml:
omniauth:
# Allow login via Twitter, Google, etc. using OmniAuth providers
enabled: true
# CAUTION!
# This allows users to login without having a user account first (default: false).
# User accounts will be created automatically when authentication was successful.
allow_single_sign_on: false
# Locks down those users until they have been cleared by the admin (default: true).
block_auto_created_users: false
# Look up new users in LDAP servers. If a match is found (same uid), automatically
# link the omniauth identity with the LDAP account. (default: false)
auto_link_ldap_user: false
providers:
- { name: 'redmine',
consumer_key: 'nyuHGr.................X1x',
consumer_secret: 'zn3z....................Cun6',
redmine_base_url: 'http://my.base_url.com/' }
configured the initializer/omniauth.rb by adding on top:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :redmine, "nyuH.........X1x", "zn3z.........Cun6", :redmine_base_url => "http://my.redmine_base.com/"
end
On the Gitlab's Sign In page I get the "Redmine" button. Clicking it puts me on the authorize page, I click on "Allow", get back to Gitlab and the 500 error page is rendered.
This is the error log on GitLab:
Started GET "/users/sign_in" for my.IP.address at 2016-01-17 03:13:07 +0100
Processing by SessionsController#new as HTML
Completed 200 OK in 293ms (Views: 66.5ms | ActiveRecord: 7.9ms)
Started POST "/users/auth/redmine" for my.IP.address at 2016-01-17 03:13:12 +0100
Processing by OmniAuth::RequestForgeryProtection::Controller#index as HTML
Parameters: {"authenticity_token"=>"[FILTERED]"}
Completed 200 OK in 1ms (ActiveRecord: 0.0ms)
Started GET "/users/auth/redmine/callback?oauth_token=[FILTERED]&oauth_verifier=EAYsTb6jJsU8SZMpUsab" for my.IP.address at 2016-01-17 03:13:14 +0100
NoMethodError (undefined method `end_with?' for nil:NilClass):
omniauth-redmine (0.0.2) lib/omniauth/strategies/redmine.rb:32:in `redmine_base_url'
omniauth-redmine (0.0.2) lib/omniauth/strategies/redmine.rb:9:in `consumer'
omniauth-oauth (1.1.0) lib/omniauth/strategies/oauth.rb:47:in `callback_phase'
omniauth (1.2.2) lib/omniauth/strategy.rb:227:in `callback_call'
omniauth (1.2.2) lib/omniauth/strategy.rb:184:in `call!'
omniauth (1.2.2) lib/omniauth/strategy.rb:164:in `call'
omniauth (1.2.2) lib/omniauth/strategy.rb:404:in `call_app!'
omniauth (1.2.2) lib/omniauth/strategy.rb:362:in `callback_phase'
omniauth-oauth (1.1.0) lib/omniauth/strategies/oauth.rb:57:in `callback_phase'
omniauth (1.2.2) lib/omniauth/strategy.rb:227:in `callback_call'
omniauth (1.2.2) lib/omniauth/strategy.rb:184:in `call!'
omniauth (1.2.2) lib/omniauth/strategy.rb:164:in `call'
omniauth (1.2.2) lib/omniauth/builder.rb:59:in `call'
rack-cors (0.4.0) lib/rack/cors.rb:80:in `call'
rack-attack (4.3.1) lib/rack/attack.rb:106:in `call'
warden (1.2.4) lib/warden/manager.rb:35:in `block in call'
warden (1.2.4) lib/warden/manager.rb:34:in `catch'
warden (1.2.4) lib/warden/manager.rb:34:in `call'
rack (1.6.4) lib/rack/etag.rb:24:in `call'
rack (1.6.4) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.4) lib/rack/head.rb:13:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.4) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.4) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
activesupport (4.2.4) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
activesupport (4.2.4) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.4) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.4) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.4) lib/rails/rack/logger.rb:20:in `call'
request_store (1.2.1) lib/request_store/middleware.rb:8:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.4) lib/rack/runtime.rb:18:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
railties (4.2.4) lib/rails/engine.rb:518:in `call'
railties (4.2.4) lib/rails/application.rb:165:in `call'
railties (4.2.4) lib/rails/railtie.rb:194:in `public_send'
railties (4.2.4) lib/rails/railtie.rb:194:in `method_missing'
rack (1.6.4) lib/rack/urlmap.rb:66:in `block in call'
rack (1.6.4) lib/rack/urlmap.rb:50:in `each'
rack (1.6.4) lib/rack/urlmap.rb:50:in `call'
unicorn (4.8.3) lib/unicorn/http_server.rb:576:in `process_client'
unicorn-worker-killer (0.4.4) lib/unicorn/worker_killer.rb:52:in `process_client'
unicorn (4.8.3) lib/unicorn/http_server.rb:670:in `worker_loop'
unicorn (4.8.3) lib/unicorn/http_server.rb:525:in `spawn_missing_workers'
unicorn (4.8.3) lib/unicorn/http_server.rb:140:in `start'
unicorn (4.8.3) bin/unicorn_rails:209:in `<top (required)>'
/usr/local/bin/unicorn_rails:23:in `load'
/usr/local/bin/unicorn_rails:23:in `<main>'
It's easier for using
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.