Giter Site home page Giter Site logo

redmine_omniauth_cas's Introduction

Redmine OmniAuth CAS plugin

This plugins adds CAS authentication support for Redmine thanks to the OmniAuth authentication framework. OmniAuth is a Rack middleware that let you authenticate against many sources (see the list of supported sources). This plugin aims at being an example of integration for the CAS protocol, but it shouldn't be that difficult to build a plugin that allows authentication against other sources.

NB: the plugin doesn't support on-the-fly registration for now.

Install

You can first take a look at general instructions for plugins here

Note that the plugin is now only compatible with Redmine 2.0.0 or higher. Compatibility with Redmine 1.x has been removed in August, 2012.

Then :

  • clone this repository in your plugins/ directory ; if you have a doubt you put it at the good level, you can go to your redmine root directoryand check you have a @plugins/redmine_omniauth_cas/init.rb@ file
  • install the dependencies with bundler : bundle install
  • copy assets by running this command from your redmine root directory (note: the plugin has no migration for now) : RAILS_ENV=production rake redmine:plugins
  • copy initializers/redmine_omniauth_cas.rb to ${REDMINE}/config/initializers/redmine_omniauth_cas.rb
  • restart your Redmine instance (depends on how you host it)

Finally you can configure your CAS server URL directly in your redmine instance, in "Administration" > "Plugins" > "Configure" on the OmniAuth CAS plugin line.

Coming soon features

Here are some ideas that could be implemented in future releases. I'm really open to suggestions on this plugin, so don't hesitate to fill an issue directly on GitHub :

  • implement ticket validation when first opening your browser (for now you’ll be considered as logged out if your session has expired on Redmine but your ticket is still valid on the CAS server)
  • add a plugin option to hide 'normal' login/password form
  • authorize on-the-fly registration
  • authorize non-conventional CAS URLs (for now you can just specify the base CAS url, and login, logout, validate, etc. URLs are deduced)

Internals

Why not use the AuthSource Redmine system ?

From a functionality point of view, Redmine's AuthSource system is useful for 2 things :

  • you want to be able to define multiple occurrences of the same authentication source => not possible afaik with OmniAuth CAS strategy
  • you want to restrict users to a certain auth source => not so interesting if the login is filled in an external form

Actually, OpenID authentication in core is not an AuthSource neither.

Why is there a default on http://localhost:9292/ everywhere ?

There are some limitations with the current implementation of OmniAuth CAS strategy. To be clear, it doesn't support dynamic parameters very well, and forces to have a default :cas_server or :cas_login_url defined in the initialization process. I hope I'll have the time to propose a fix or develop my own CAS strategy soon.

Contribute

If you like this plugin, it's a good idea to contribute :

  • by giving feed back on what is cool, what should be improved
  • by reporting bugs : you can open issues directly on github for the moment
  • by forking it and sending pull request if you have a patch or a feature you want to implement

Changelog

master/current

  • Fix: avoid potential errors when "service_validate" option is not set in plugin configuration, leading to 500 error after CAS redirect
  • Fix: correctly update User#last_login_on when authenticating through CAS
  • Fix: disable SSL certificate verification since it's totally broken
  • Fix: repare different url for validation
  • Feature: upgrade to OmniAuth 1.x and Redmine 2.x
  • Feature: clean log out from CAS for users logged in through CAS
  • Feature: supported Redmine 5.x

v0.1.2

  • Feature: allow having a different host for ticket validation (think: internet redirect for user's login, but ticket validation done through internal URL)

v0.1.1

  • Fix: avoid potential 500 error with some CAS servers when using the (bad) default :cas_server option
  • Fix: do not show CAS button on login page if CAS URL is not set
  • Fix: bad default :cas_server URL, lead to malformed '/login' URL not supported by rubycas-server

v0.1.0 (first release)

  • Feature: upgrade to Redmine >= 1.2.0, since the latest versions of OmniAuth do not support Rack 1.0.1
  • Feature: provide a link to logout from CAS completely if username doesn't exist in redmine
  • Feature: make the CAS server URL configurable
  • Feature: provide a way to override standard text on login page
  • Feature: configure OmniAuth 'full_host' in case the application runs behing a reverse-proxy
  • Feature: basic CAS login

Test status

Plugin branch Redmine Version Test Status
master 4.2.11 4.2.11
master 5.1.2 5.1.2
master master master

License

This project is released under the MIT license, see LICENSE file.

redmine_omniauth_cas's People

Contributors

fcrespel avatar jbbarth avatar mingming-cn avatar nanego avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redmine_omniauth_cas's Issues

Unable to add OmniAuth::Builder middleware as the middleware stack is frozen

Hi,

Many thanks for this plugin 😄

I'm trying to upgrade our redmine instance from 4.2.10 to 5.x, and with whichever 5.x release I try (tried 5.0.0, 5.0.5 and 5.1.1) I encounter this error when running the command RAILS_ENV=production rake redmine:plugins:

/!\ Unable to add OmniAuth::Builder middleware as the middleware stack is frozen

Here is the complete log of the installation:

$ docker exec -it redmine /bin/bash
root@redmine:/usr/src/redmine# cd plugins/
root@redmine:/usr/src/redmine/plugins# git clone https://github.com/jbbarth/redmine_omniauth_cas.git
Cloning into 'redmine_omniauth_cas'...
remote: Enumerating objects: 726, done.
remote: Counting objects: 100% (131/131), done.
remote: Compressing objects: 100% (82/82), done.
remote: Total 726 (delta 67), reused 91 (delta 36), pack-reused 595
Receiving objects: 100% (726/726), 100.89 KiB | 983.00 KiB/s, done.
Resolving deltas: 100% (298/298), done.
root@redmine:/usr/src/redmine/plugins# bundle install
Your Gemfile lists the gem puma (>= 0) more than once.
You should probably keep only one of them.
Remove any duplicate entries and specify the gem only once.
While it's not a problem now, it could cause errors if you change the version of one of them later.
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Fetching hashie 5.0.0
Installing hashie 5.0.0
Fetching omniauth 1.9.2
Installing omniauth 1.9.2
Fetching omniauth-cas 1.1.1
Installing omniauth-cas 1.1.1
Bundle complete! 44 Gemfile dependencies, 77 gems now installed.
Gems in the groups 'development' and 'test' were not installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
root@redmine:/usr/src/redmine/plugins# cd ..
root@redmine:/usr/src/redmine# RAILS_ENV=production rake redmine:plugins
W, [2024-02-24T14:16:22.826247 #64]  WARN -- : Unable to add OmniAuth::Builder middleware as the middleware stack is frozen
/!\ Unable to add OmniAuth::Builder middleware as the middleware stack is frozen
W, [2024-02-24T14:16:22.975757 #64]  WARN -- : Creating scope :system. Overwriting existing method Enumeration.system.
W, [2024-02-24T14:16:23.143663 #64]  WARN -- : Creating scope :sorted. Overwriting existing method User.sorted.

Then after restarting the instance it fails with:

=> Booting Puma
=> Rails 6.1.7.6 application starting in production 
=> Run `bin/rails server --help` for more startup options
W, [2024-02-24T14:21:06.660219 #1]  WARN -- : Unable to add OmniAuth::Builder middleware as the middleware stack is frozen
/!\ Unable to add OmniAuth::Builder middleware as the middleware stack is frozen
W, [2024-02-24T14:21:06.784926 #1]  WARN -- : Creating scope :system. Overwriting existing method Enumeration.system.
W, [2024-02-24T14:21:06.961181 #1]  WARN -- : Creating scope :sorted. Overwriting existing method User.sorted.
Exiting
/usr/local/bundle/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/helpers.rb:135:in `const_get': uninitialized constant Omniauth::DynamicFullHost (NameError)

    parent.const_get(cname, false)
          ^^^^^^^^^^
        from /usr/local/bundle/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/helpers.rb:135:in `cget'
        from /usr/local/bundle/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/eager_load.rb:175:in `block in actual_eager_load_dir'
        from /usr/local/bundle/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/helpers.rb:40:in `block in ls'
        from /usr/local/bundle/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/helpers.rb:25:in `each'
        from /usr/local/bundle/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/helpers.rb:25:in `ls'
        from /usr/local/bundle/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/eager_load.rb:170:in `actual_eager_load_dir'
        from /usr/local/bundle/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/eager_load.rb:17:in `block (2 levels) in eager_load'
        from /usr/local/bundle/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/eager_load.rb:16:in `each'
        from /usr/local/bundle/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/eager_load.rb:16:in `block in eager_load'
        from /usr/local/bundle/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/eager_load.rb:10:in `synchronize'
        from /usr/local/bundle/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/eager_load.rb:10:in `eager_load'
        from /usr/local/bundle/gems/zeitwerk-2.6.13/lib/zeitwerk/loader.rb:379:in `block in eager_load_all'
        from /usr/local/bundle/gems/zeitwerk-2.6.13/lib/zeitwerk/loader.rb:377:in `each'
        from /usr/local/bundle/gems/zeitwerk-2.6.13/lib/zeitwerk/loader.rb:377:in `eager_load_all'
        from /usr/local/bundle/gems/railties-6.1.7.6/lib/rails/application/finisher.rb:133:in `block in <module:Finisher>'
        from /usr/local/bundle/gems/railties-6.1.7.6/lib/rails/initializable.rb:32:in `instance_exec'
        from /usr/local/bundle/gems/railties-6.1.7.6/lib/rails/initializable.rb:32:in `run'
        from /usr/local/bundle/gems/railties-6.1.7.6/lib/rails/initializable.rb:61:in `block in run_initializers'
        from /usr/local/lib/ruby/3.2.0/tsort.rb:228:in `block in tsort_each'
        from /usr/local/lib/ruby/3.2.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        from /usr/local/lib/ruby/3.2.0/tsort.rb:431:in `each_strongly_connected_component_from'
        from /usr/local/lib/ruby/3.2.0/tsort.rb:349:in `block in each_strongly_connected_component'
        from /usr/local/lib/ruby/3.2.0/tsort.rb:347:in `each'
        from /usr/local/lib/ruby/3.2.0/tsort.rb:347:in `call'
        from /usr/local/lib/ruby/3.2.0/tsort.rb:347:in `each_strongly_connected_component'
        from /usr/local/lib/ruby/3.2.0/tsort.rb:226:in `tsort_each'
        from /usr/local/lib/ruby/3.2.0/tsort.rb:205:in `tsort_each'
        from /usr/local/bundle/gems/railties-6.1.7.6/lib/rails/initializable.rb:60:in `run_initializers'
        from /usr/local/bundle/gems/railties-6.1.7.6/lib/rails/application.rb:391:in `initialize!'
        from /usr/src/redmine/config/environment.rb:16:in `<top (required)>'
        from config.ru:3:in `require_relative'
        from config.ru:3:in `block in <main>'
        from /usr/local/bundle/gems/rack-2.2.8/lib/rack/builder.rb:116:in `eval'
        from /usr/local/bundle/gems/rack-2.2.8/lib/rack/builder.rb:116:in `new_from_string'
        from /usr/local/bundle/gems/rack-2.2.8/lib/rack/builder.rb:105:in `load_file'
        from /usr/local/bundle/gems/rack-2.2.8/lib/rack/builder.rb:66:in `parse_file'
        from /usr/local/bundle/gems/rack-2.2.8/lib/rack/server.rb:349:in `build_app_and_options_from_config'
        from /usr/local/bundle/gems/rack-2.2.8/lib/rack/server.rb:249:in `app'
        from /usr/local/bundle/gems/rack-2.2.8/lib/rack/server.rb:422:in `wrapped_app'
        from /usr/local/bundle/gems/rack-2.2.8/lib/rack/server.rb:312:in `block in start'
        from /usr/local/bundle/gems/rack-2.2.8/lib/rack/server.rb:379:in `handle_profiling'
        from /usr/local/bundle/gems/rack-2.2.8/lib/rack/server.rb:311:in `start'
        from /usr/local/bundle/gems/railties-6.1.7.6/lib/rails/commands/server/server_command.rb:39:in `start'
        from /usr/local/bundle/gems/railties-6.1.7.6/lib/rails/commands/server/server_command.rb:144:in `block in perform'
        from <internal:kernel>:90:in `tap'
        from /usr/local/bundle/gems/railties-6.1.7.6/lib/rails/commands/server/server_command.rb:135:in `perform'
        from /usr/local/bundle/gems/thor-1.3.0/lib/thor/command.rb:28:in `run'
        from /usr/local/bundle/gems/thor-1.3.0/lib/thor/invocation.rb:127:in `invoke_command'
        from /usr/local/bundle/gems/thor-1.3.0/lib/thor.rb:527:in `dispatch'
        from /usr/local/bundle/gems/railties-6.1.7.6/lib/rails/command/base.rb:69:in `perform'
        from /usr/local/bundle/gems/railties-6.1.7.6/lib/rails/command.rb:48:in `invoke'
        from /usr/local/bundle/gems/railties-6.1.7.6/lib/rails/commands.rb:18:in `<top (required)>'
        from <internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from <internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from bin/rails:4:in `<main>'

Any clue appreciated 😄

404 when accessing configuration page

Installed the plugin (rake command picked it up) and I can see it listed in the plugins list. When I click on "Configure" I get a 404 error. Here's what the log file shows:

Started GET "/redmine/settings/plugin/redmine_omniauth_cas" for xx.xx.xx.xx at 2018-11-26 11:13:04 -0500
Processing by SettingsController#plugin as HTML
  Parameters: {"id"=>"redmine_omniauth_cas"}
  Current user: xxxxxxxx (id=8)
  Rendered settings/plugin.html.erb within layouts/admin (3.0ms)
Missing template, responding with 404
  Rendered common/error.html.erb within layouts/base (0.6ms)
Completed 404 Not Found in 54ms (Views: 11.9ms | ActiveRecord: 14.4ms)

When I do a find for the missing template, I do find it in: ./app/views/settings/plugin.html.erb (relative to the redmine root dir)

Version info:

Environment:
  Redmine version                3.2.1.stable
  Ruby version                   2.3.1-p112 (2016-04-26) [x86_64-linux-gnu]
  Rails version                  4.2.6
  Environment                    production
  Database adapter               PostgreSQL
SCM:
  Git                            2.7.4
  Filesystem                     
Redmine plugins:
  redmine_omniauth_cas           3.3.0

undefined method `cas_host' for class `OmniAuth::Strategies::CAS'

Hi there,

first of all: thanks for this great plugin!

Unfortunately, after migrating my Redmine 2.2 Installation to a Server running Ruby 1.9.3 and Rails 3.2.13, I get the following error:

undefined method cas_host' for classOmniAuth::Strategies::CAS'
/home/rails/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/core_ext/module/aliasing.rb:31:in alias_method' /home/rails/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/core_ext/module/aliasing.rb:31:inalias_method_chain'

Is this an issue with with my activesupport gem?

Create user from ldap

I have CAS service to authenticate user which search user in LDAP.
It would be nice if:
If user does not exist's in redmine it will be create from LDAP database. I mean to use build in LDAP authenticate service to search user and create it if it is found in LDAP. Other case redmine ask new user to fill in registriation form.
In my case user always will found because of CAS authentication. For me it is nicley on the fly user create.

Compatibility with redmine 5.0

Hi,
Is this plugin intended to work with redmine 5.0 ?
We would like to continue to use both CAS and redmine authentication and this plugin is the only one that allows us this.
Thank you

Document what "No Support of on-the-fly registration" means

Hi,
Thanks for this redmine plugin
!
The Readme is short and precise but It would be nice if you could add a line or two telling what are the implication of "no support of on-the-fly registration" regarding the redmine configuration process please.
Newbie here, so please tell me if i'm wrong, but it seems that in order to successfully authenticate CAS users with this plugin, the redmine administrator has to:

  • disable "Minimum password length" requirement (set it to '0') in "Administration > Settings > Authentication". Required for the second step below
  • and Create (or better import if that's possible) all the CAS users login via the redmine "Administration > Users > New user" settings

Failing to do so, results in the redmine authentication process failing with this error message (in redmine/logs/production.log) "Failed login for '<redacted_cas_user_login'> from at 2013-10-16 03:15:24 UTC
Redirected to http://<redacted_redmine_hostname>/login"

Am i wrong ?
How do you guys import en masse your CAS users into Redmine please ?

Thanks.

License

I would like to use your CAS plugin for my organization's Redmine installation but unfortunately can't since there is no licensing information. Could you please add a LICENSE file to the repo?

Thank you very much!

Edit: I guess it's the same as Redmine but a clarification wouldn't harm.

Problems migrating plugins

Hi, I have problems migrating plugins.

root@ubuntu:/data/home/redmine-2.1.4# RAILS_ENV=production rake redmine:plugins
rake aborted!
/data/home/redmine-2.1.4/plugins/redmine_omniauth_cas/lib/redmine_omniauth_cas/account_controller_patch.rb:34: syntax error, unexpected '.', expecting kEND
.merge("./logout?gateway=1&serv...
^
/data/home/redmine-2.1.4/plugins/redmine_omniauth_cas/lib/redmine_omniauth_cas/account_controller_patch.rb:35: syntax error, unexpected '.', expecting kEND
.to_s
^

I´m using Redmine 2.1.4, Rails 3.2.8, ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-linux], Gems 1.8.24.

I tested with https://github.com/fcrespel/redmine_omniauth_cas.git and the problem it´s resolved.

Plugin works fine with Redmine 3.3.0.stable

Works fine with:
Environment:
Redmine version 3.3.0.stable
Ruby version 2.1.5-p273 (2014-11-13) [x86_64-linux-gnu]
Rails version 4.2.6
Environment production
Database adapter PostgreSQL
SCM:
Subversion 1.8.10
Git 2.1.4

The only thing i get is "Not found" - Redmine 3.2.2

Hello,

I'm in trouble.
As anyone made it work with redmine 3.2.2 ?

The generated connection link is :
https://redmine_path/auth/cas?origin=origin_url
Which follows the route to "login_with_cas_redirect"
Which displays "not found" on the screen.

Thanks in advance for any hint that could help me :)

(I have an other question after this one, the origin url is wrong, probably because i'm behind a reverse proxy, I also take ideas about this one !)

Configurable CAS attributes

Hi.

So my CAS provider uses different names for attributes such as the person's unique ID, name, nickname, email..
When using the omniauth-cas strategy, it is possible to change these attribute's label/tag/name or whatever. It could be a good feature for your plugin to allow this customization within the administration area, where the plugin is configured.

Error 500 - Invalid CAS ticket when redirect URL Contains Query Params

Hello,
thanks for the amazing plugin <3
When the URL contains query params for example myredmine.com/issues?query_id=108 im getting redirected to the error page after authetication:

500
An invalid CAS ticket was specified, it may have expired. Please try authenticating in again.

After reloading the page I am getting redirected to the correct page and everything works fine.
Any suggestions?

Regards
linogfant

ActionView::Template::Error (undefined local variable or method `label_for_cas_login'

Hello, thank you for your plugin, it's the only one I found and who
operate with Redmine 3.3.9,
when I load the plugin "Redmine Login Audit 0.3.3" at https://github.com/martin-denizet/redmine_login_audit, the login link does not work, I have a 500 error, see the diary below.

I also tried with version 3.4.9 and version 4.0 of redmine without success. I did not succeed in correcting the problems.

Do you think you can fix the problem?

I thank you in advance.

My environment

Environment:
  Redmine version           3.3.9.stable
  Ruby version                 2.3.0-p0 (2015-12-25) [x86_64-linux]
  Rails version                  4.2.11
  Environment                 production
  Database adapter         Mysql2
SCM:
  Git                                 2.1.4
  Filesystem                     
Redmine plugins:
  redmine_omniauth_cas      3.3.0
  redmine_xls_export            0.2.1.t11
  sidebar_hide                      0.0.8

I have the same error with the 0.1.2 3.4.6 or master source.

ActionView::Template::Error (undefined local variable or method `label_for_cas_login' for #<#Class:0x00563271334538:0x007fd105a32310>
Did you mean? labelled_form_for):

The log

Processing by AccountController#login as HTML
  Current user: anonymous
  Rendered plugins/redmine_omniauth_cas/app/views/redmine_omniauth_cas/_view_account_login_top.html.erb (55.3ms)
  Rendered account/login.html.erb within layouts/base (55.7ms)
Completed 500 Internal Server Error in 58ms (ActiveRecord: 0.2ms)

ActionView::Template::Error (undefined local variable or method `label_for_cas_login' for #<#<Class:0x00563271334538>:0x007fd105a32310>
Did you mean?  labelled_form_for):
    11:     #(it happens for me at work with 2 reverse-proxies in front of the app...)
    12:     @back_url = CGI.unescape(@back_url) if @back_url && @back_url.match(/^https?%3A/)
    13:   %>
    14:   <%= link_to label_for_cas_login, :controller => "account", :action => "login_with_cas_redirect", :provider => "cas", :origin => @back_url %>
    15: </div>
    16:
    17: <% end %>
  plugins/redmine_omniauth_cas/app/views/redmine_omniauth_cas/_view_account_login_top.html.erb:14:in `_plugins_redmine_omniauth_cas_app_views_redmine_omniauth_cas__view_account_login_top_html_erb__519223562586077569_47387324155000'
  lib/redmine/hook/view_listener.rb:59:in `block (2 levels) in render_on'
  lib/redmine/hook/view_listener.rb:57:in `map'
  lib/redmine/hook/view_listener.rb:57:in `block in render_on'
  lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'
  lib/redmine/hook.rb:61:in `each'
  lib/redmine/hook.rb:61:in `block in call_hook'
  lib/redmine/hook.rb:58:in `tap'
  lib/redmine/hook.rb:58:in `call_hook'
  lib/redmine/hook.rb:96:in `call_hook'
  app/views/account/login.html.erb:1:in `_app_views_account_login_html_erb__689247372787559154_47387323859960'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

Login callback error

Hi,

I configured the plugin with our CAS central server, but when we login in the CAS, the login is OK and the redirects to redmine and an error occurs.

NoMethodError (undefined method +' for nil:NilClass): /usr/lib/ruby/1.8/net/http.rb:1118:inaddr_port'
/usr/lib/ruby/1.8/net/http.rb:1078:in begin_transport' /usr/lib/ruby/1.8/net/http.rb:1048:inrequest'
/usr/lib/ruby/1.8/net/http.rb:772:in get' omniauth-cas (1.0.0) lib/omniauth/strategies/cas/service_ticket_validator.rb:86:inget_service_response_body'
/usr/lib/ruby/1.8/net/http.rb:543:in start' omniauth-cas (1.0.0) lib/omniauth/strategies/cas/service_ticket_validator.rb:85:inget_service_response_body'
omniauth-cas (1.0.0) lib/omniauth/strategies/cas/service_ticket_validator.rb:32:in user_info' omniauth-cas (1.0.0) lib/omniauth/strategies/cas.rb:67:incallback_phase'
omniauth (1.1.1) lib/omniauth/strategy.rb:219:in callback_call' omniauth (1.1.1) lib/omniauth/strategy.rb:175:incall!'
omniauth (1.1.1) lib/omniauth/strategy.rb:157:in call' omniauth (1.1.1) lib/omniauth/builder.rb:48:incall'
rack-openid (1.3.1) lib/rack/openid.rb:98:in call' actionpack (3.2.8) lib/action_dispatch/middleware/best_standards_support.rb:17:incall'
rack (1.4.1) lib/rack/etag.rb:23:in call' rack (1.4.1) lib/rack/conditionalget.rb:25:incall'
actionpack (3.2.8) lib/action_dispatch/middleware/head.rb:14:in call' actionpack (3.2.8) lib/action_dispatch/middleware/params_parser.rb:21:incall'
actionpack (3.2.8) lib/action_dispatch/middleware/flash.rb:242:in call' rack (1.4.1) lib/rack/session/abstract/id.rb:205:incontext'
rack (1.4.1) lib/rack/session/abstract/id.rb:200:in call' actionpack (3.2.8) lib/action_dispatch/middleware/cookies.rb:339:incall'
activerecord (3.2.8) lib/active_record/query_cache.rb:64:in call' activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:473:incall'
actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:28:in call' activesupport (3.2.8) lib/active_support/callbacks.rb:405:in_run__866538101__call__4__callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:405:in send' 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:insend'
activesupport (3.2.8) lib/active_support/callbacks.rb:81:in run_callbacks' actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:27:incall'
actionpack (3.2.8) lib/action_dispatch/middleware/remote_ip.rb:31:in call' actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:16:incall'
actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:in call' railties (3.2.8) lib/rails/rack/logger.rb:26:incall_app'
railties (3.2.8) lib/rails/rack/logger.rb:16:in call' actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:incall'
rack (1.4.1) lib/rack/methodoverride.rb:21:in call' rack (1.4.1) lib/rack/runtime.rb:17:incall'
activesupport (3.2.8) lib/active_support/cache/strategy/local_cache.rb:72:in call' rack (1.4.1) lib/rack/lock.rb:15:incall'
actionpack (3.2.8) lib/action_dispatch/middleware/static.rb:62:in call' rack-cache (1.2) lib/rack/cache/context.rb:136:inforward'
rack-cache (1.2) lib/rack/cache/context.rb:245:in fetch' rack-cache (1.2) lib/rack/cache/context.rb:185:inlookup'
rack-cache (1.2) lib/rack/cache/context.rb:66:in call!' rack-cache (1.2) lib/rack/cache/context.rb:51:incall'
railties (3.2.8) lib/rails/engine.rb:479:in call' railties (3.2.8) lib/rails/application.rb:223:incall'
rack (1.4.1) lib/rack/content_length.rb:14:in call' railties (3.2.8) lib/rails/rack/log_tailer.rb:17: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

In the stacktrace looks that there is a problem validating the cas ticket.

My enviroment is:

Ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-linux]
Rails 3.2.8
RubyGems 1.8.24
Redmine 2.1.4
Jasig Central Authentication Service 3.5.1

Thanks.

Invalid CAS Ticket

Hi, I was trying out this plugin but can't seem to get it working with an already working Cas server (other apps seem to work ok). Is this a configuration error?. This is the output in the logs:

Filter chain halted as :check_if_login_required rendered or redirected
Completed 302 Found in 240ms (ActiveRecord: 82.8ms)
Started GET "/login?back_url=http%3A%2F%2F172.30.168.29%3A3000%2F" for 172.30.17 2.75 at 2013-02-06 11:46:37 -0600
Processing by AccountController#login as HTML
Parameters: {"back_url"=>"http://172.30.168.29:3000/"}
Current user: anonymous
Rendered plugins/redmine_omniauth_cas/app/views/redmine_omniauth_cas/_view_acc ount_login_top.html.erb (133.6ms)
Rendered account/login.html.erb within layouts/base (218.1ms)
Completed 200 OK in 368ms (Views: 359.9ms | ActiveRecord: 4.0ms)
(cas) Setup endpoint detected, running now.
(cas) Request phase initiated.
Started GET "/auth/cas?origin=http%3A%2F%2F172.30.168.29%3A3000%2F" for 172.30.1 72.75 at 2013-02-06 11:48:04 -0600
(cas) Setup endpoint detected, running now.
(cas) Callback phase initiated.
(cas) Authentication failure! invalid_ticket: OmniAuth::Strategies::CAS::Invalid CASTicket, Invalid CAS Ticket
Started GET "/auth/cas/callback?origin=http%3A%2F%2F172.30.168.29%3A3000%2F&tick et=ST-2295-nvQCt6UJ2uibaNk7Y7yz-cas" for 172.30.172.75 at 2013-02-06 11:50:48 -0 600
Started GET "/auth/failure?message=invalid_ticket&origin=http%3A%2F%2F172.30.168 .29%3A3000%2F&strategy=cas" for 172.30.172.75 at 2013-02-06 11:51:19 -0600
Processing by AccountController#login_with_cas_failure as HTML
Parameters: {"message"=>"invalid_ticket", "origin"=>"http://172.30.168.29:3000 /", "strategy"=>"cas"}
Current user: anonymous
Redirected to http://172.30.168.29:3000/login
Completed 302 Found in 4ms (ActiveRecord: 0.9ms)
Started GET "/login" for 172.30.172.75 at 2013-02-06 11:51:49 -0600
Processing by AccountController#login as HTML
Current user: anonymous
Rendered plugins/redmine_omniauth_cas/app/views/redmine_omniauth_cas/_view_acc ount_login_top.html.erb (1.1ms)
Rendered account/login.html.erb within layouts/base (2.3ms)
Completed 200 OK in 8ms (Views: 5.9ms | ActiveRecord: 0.8ms)

Maybe the Single logout not working

Environment:
Redmine version 2.5.2.stable
Ruby version 2.1.3-p242 (2014-09-19) [x86_64-linux]
Rails version 3.2.19
Environment production
Database adapter Mysql2
Cas SERVER v4.0
redmine_omniauth_cas 0.1.2

The sign in with Jenkins and Redmine is done with CAS

When i logout from jenkins, i am not logged out from redmine

httpd ssl_access_log
172.31.138.91 - - [22/Oct/2014:14:40:04 +0200] "GET /jenkins/logout HTTP/1.1" 302 -
172.31.138.91 - - [22/Oct/2014:14:40:04 +0200] "GET /cas/logout?service=https%3A%2F%2Fcentos-pic1.znet%2Fjenkins%2F HTTP/1.1" 200 1693
172.31.138.91 - - [22/Oct/2014:14:40:05 +0200] "POST /jenkins/securityRealm/finishLogin HTTP/1.1" 200 -
172.31.138.91 - - [22/Oct/2014:14:40:05 +0200] "POST /redmine/auth/cas/callback?origin=https%3A%2F%2Fcentos-pic1.znet%2Fredmine%2F HTTP/1.1" 302 9

httpd ssl_request_log
[22/Oct/2014:14:40:04 +0200] 172.31.138.91 TLSv1.2 DHE-RSA-AES128-SHA "GET /jenkins/logout HTTP/1.1" -
[22/Oct/2014:14:40:04 +0200] 172.31.138.91 TLSv1.2 DHE-RSA-AES128-SHA "GET /cas/logout?service=https%3A%2F%2Fcentos-pic1.znet%2Fjenkins%2F HTTP/1.1" 1693
[22/Oct/2014:14:40:05 +0200] 172.31.138.91 TLSv1.2 AES128-SHA256 "POST /jenkins/securityRealm/finishLogin HTTP/1.1" -
[22/Oct/2014:14:40:05 +0200] 172.31.138.91 TLSv1.2 AES128-SHA256 "POST /redmine/auth/cas/callback?origin=https%3A%2F%2Fcentos-pic1.znet%2Fredmine%2F HTTP/1.1" 9

httpd error_log
App 5439 stdout: (cas) Authentication failure! no_ticket: OmniAuth::Strategies::CAS::MissingCASTicket, No CAS Ticket

This is a bug or i am missing something ?

Error when coming back from CAS server to Redmine application

Hi,

we have installed the plugin to be able to authenticate users against a CAS server. The user clicks on the "login with CAS" button, goes correctly to the CAS authentication, authenticates but after that the response from Redmine is an error:

this is production.log

`Started GET "/redmine2/auth/cas?origin=https%3A%2F%2Fwww-[customerIP].es%2Fredmine2%2F" for 10.166.68.8 at 2022-01-18 09:25:38 +0100
Started GET "/redmine2/auth/cas/callback?origin=https%3A%2F%2Fwww-[customerIP].es%2Fredmine2%2F&ticket=ST-639-59ncpzKg4JK0u070sRPe-linosa2-pre" for 10.166.68.8 at 2022-01-18 09:25:38 +0100

Net::OpenTimeout (execution expired):

/usr/lib64/ruby/2.5.0/net/http.rb:937:in initialize' /usr/lib64/ruby/2.5.0/net/http.rb:937:in open'
/usr/lib64/ruby/2.5.0/net/http.rb:937:in block in connect' /usr/lib64/ruby/2.5.0/timeout.rb:103:in timeout'
/usr/lib64/ruby/2.5.0/net/http.rb:935:in connect' /usr/lib64/ruby/2.5.0/net/http.rb:920:in do_start'
/usr/lib64/ruby/2.5.0/net/http.rb:909:in start' omniauth-cas (1.1.1) lib/omniauth/strategies/cas/service_ticket_validator.rb:94:in get_service_response_body'
omniauth-cas (1.1.1) lib/omniauth/strategies/cas/service_ticket_validator.rb:24:in call' omniauth-cas (1.1.1) lib/omniauth/strategies/cas.rb:186:in validate_service_ticket'
omniauth-cas (1.1.1) lib/omniauth/strategies/cas.rb:192:in fetch_raw_info' omniauth-cas (1.1.1) lib/omniauth/strategies/cas.rb:84:in callback_phase'
omniauth (1.9.1) lib/omniauth/strategy.rb:238:in callback_call' omniauth (1.9.1) lib/omniauth/strategy.rb:189:in call!'
omniauth (1.9.1) lib/omniauth/strategy.rb:169:in call' omniauth (1.9.1) lib/omniauth/builder.rb:45:in call'
rack-openid (1.4.2) lib/rack/openid.rb:98:in call' rack (2.2.3) lib/rack/tempfile_reaper.rb:15:in call'
rack (2.2.3) lib/rack/etag.rb:27:in call' rack (2.2.3) lib/rack/conditional_get.rb:27:in call'
rack (2.2.3) lib/rack/head.rb:12:in call' actionpack (5.2.5) lib/action_dispatch/http/content_security_policy.rb:18:in call'
rack (2.2.3) lib/rack/session/abstract/id.rb:266:in context' rack (2.2.3) lib/rack/session/abstract/id.rb:260:in call'
actionpack (5.2.5) lib/action_dispatch/middleware/cookies.rb:670:in call' actionpack (5.2.5) lib/action_dispatch/middleware/callbacks.rb:28:in block in call'
activesupport (5.2.5) lib/active_support/callbacks.rb:98:in run_callbacks' actionpack (5.2.5) lib/action_dispatch/middleware/callbacks.rb:26:in call'
actionpack (5.2.5) lib/action_dispatch/middleware/debug_exceptions.rb:61:in call' actionpack (5.2.5) lib/action_dispatch/middleware/show_exceptions.rb:33:in call'
railties (5.2.5) lib/rails/rack/logger.rb:38:in call_app' railties (5.2.5) lib/rails/rack/logger.rb:26:in block in call'
activesupport (5.2.5) lib/active_support/tagged_logging.rb:71:in block in tagged' activesupport (5.2.5) lib/active_support/tagged_logging.rb:28:in tagged'
activesupport (5.2.5) lib/active_support/tagged_logging.rb:71:in tagged' railties (5.2.5) lib/rails/rack/logger.rb:26:in call'
actionpack (5.2.5) lib/action_dispatch/middleware/remote_ip.rb:81:in call' request_store (1.4.1) lib/request_store/middleware.rb:19:in call'
actionpack (5.2.5) lib/action_dispatch/middleware/request_id.rb:27:in call' rack (2.2.3) lib/rack/method_override.rb:24:in call'
rack (2.2.3) lib/rack/runtime.rb:22:in call' activesupport (5.2.5) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in call'
actionpack (5.2.5) lib/action_dispatch/middleware/executor.rb:14:in call' actionpack (5.2.5) lib/action_dispatch/middleware/static.rb:127:in call'
rack (2.2.3) lib/rack/sendfile.rb:110:in call' rack (2.2.3) lib/rack/content_length.rb:17:in call'
railties (5.2.5) lib/rails/engine.rb:524:in call' passenger (6.0.9) src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb:107:in process_request'
passenger (6.0.9) src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb:149:in accept_and_process_next_request' passenger (6.0.9) src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb:110:in main_loop'
passenger (6.0.9) src/ruby_supportlib/phusion_passenger/request_handler.rb:416:in block (3 levels) in start_threads' passenger (6.0.9) src/ruby_supportlib/phusion_passenger/utils.rb:113:in block in create_thread_and_abort_on_exception'

Net::OpenTimeout (execution expired):

/usr/lib64/ruby/2.5.0/net/http.rb:937:in initialize' /usr/lib64/ruby/2.5.0/net/http.rb:937:in open'
/usr/lib64/ruby/2.5.0/net/http.rb:937:in block in connect' /usr/lib64/ruby/2.5.0/timeout.rb:103:in timeout'
/usr/lib64/ruby/2.5.0/net/http.rb:935:in connect' /usr/lib64/ruby/2.5.0/net/http.rb:920:in do_start'
/usr/lib64/ruby/2.5.0/net/http.rb:909:in start' omniauth-cas (1.1.1) lib/omniauth/strategies/cas/service_ticket_validator.rb:94:in get_service_response_body'
omniauth-cas (1.1.1) lib/omniauth/strategies/cas/service_ticket_validator.rb:24:in call' omniauth-cas (1.1.1) lib/omniauth/strategies/cas.rb:186:in validate_service_ticket'
omniauth-cas (1.1.1) lib/omniauth/strategies/cas.rb:192:in fetch_raw_info' omniauth-cas (1.1.1) lib/omniauth/strategies/cas.rb:84:in callback_phase'
omniauth (1.9.1) lib/omniauth/strategy.rb:238:in callback_call' omniauth (1.9.1) lib/omniauth/strategy.rb:189:in call!'
omniauth (1.9.1) lib/omniauth/strategy.rb:169:in call' omniauth (1.9.1) lib/omniauth/builder.rb:45:in call'
rack-openid (1.4.2) lib/rack/openid.rb:98:in call' rack (2.2.3) lib/rack/tempfile_reaper.rb:15:in call'
rack (2.2.3) lib/rack/etag.rb:27:in call' rack (2.2.3) lib/rack/conditional_get.rb:27:in call'
rack (2.2.3) lib/rack/head.rb:12:in call' actionpack (5.2.5) lib/action_dispatch/http/content_security_policy.rb:18:in call'
rack (2.2.3) lib/rack/session/abstract/id.rb:266:in context' rack (2.2.3) lib/rack/session/abstract/id.rb:260:in call'
actionpack (5.2.5) lib/action_dispatch/middleware/cookies.rb:670:in call' actionpack (5.2.5) lib/action_dispatch/middleware/callbacks.rb:28:in block in call'
activesupport (5.2.5) lib/active_support/callbacks.rb:98:in run_callbacks' actionpack (5.2.5) lib/action_dispatch/middleware/callbacks.rb:26:in call'
actionpack (5.2.5) lib/action_dispatch/middleware/debug_exceptions.rb:61:in call' actionpack (5.2.5) lib/action_dispatch/middleware/show_exceptions.rb:33:in call'
railties (5.2.5) lib/rails/rack/logger.rb:38:in call_app' railties (5.2.5) lib/rails/rack/logger.rb:26:in block in call'
activesupport (5.2.5) lib/active_support/tagged_logging.rb:71:in block in tagged' activesupport (5.2.5) lib/active_support/tagged_logging.rb:28:in tagged'
activesupport (5.2.5) lib/active_support/tagged_logging.rb:71:in tagged' railties (5.2.5) lib/rails/rack/logger.rb:26:in call'
actionpack (5.2.5) lib/action_dispatch/middleware/remote_ip.rb:81:in call' request_store (1.4.1) lib/request_store/middleware.rb:19:in call'
actionpack (5.2.5) lib/action_dispatch/middleware/request_id.rb:27:in call' rack (2.2.3) lib/rack/method_override.rb:24:in call'
rack (2.2.3) lib/rack/runtime.rb:22:in call' activesupport (5.2.5) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in call'
actionpack (5.2.5) lib/action_dispatch/middleware/executor.rb:14:in call' actionpack (5.2.5) lib/action_dispatch/middleware/static.rb:127:in call'
rack (2.2.3) lib/rack/sendfile.rb:110:in call' rack (2.2.3) lib/rack/content_length.rb:17:in call'
railties (5.2.5) lib/rails/engine.rb:524:in call' passenger (6.0.9) src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb:107:in process_request'
passenger (6.0.9) src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb:149:in accept_and_process_next_request' passenger (6.0.9) src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb:110:in main_loop'
passenger (6.0.9) src/ruby_supportlib/phusion_passenger/request_handler.rb:416:in block (3 levels) in start_threads' passenger (6.0.9) src/ruby_supportlib/phusion_passenger/utils.rb:113:in block in create_thread_and_abort_on_exception'
`

Two hints to help debug:

  • customer used Redmine CAS plugin in their old Redmine, but it is not compatible with the new one, so we changed to this Omniauth_CAS plugin
  • there is a squid proxy between Redmine and CAS server

It would be nice if someone could assess this issue to give us some clues on what is causing the Redmine error.
Thank you very much in advance.

Error installing

Hello.
Unable to install plugin. Fails with error:

rake redmine:plugins RAILS_ENV=production --trace
** Invoke redmine:plugins (first_time)
** Execute redmine:plugins
** Invoke redmine:plugins:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
NameError: uninitialized constant ActiveSupport::Reloader
/usr/share/redmine/plugins/redmine_omniauth_cas/init.rb:8:in <top (required)>' /usr/share/redmine/lib/redmine/plugin.rb:155:in block in load'
/usr/share/redmine/lib/redmine/plugin.rb:146:in each' /usr/share/redmine/lib/redmine/plugin.rb:146:in load'
/usr/share/redmine/config/initializers/30-redmine.rb:21:in <top (required)>' /usr/lib/ruby/vendor_ruby/rails/engine.rb:652:in block in load_config_initializer'
/usr/lib/ruby/vendor_ruby/active_support/notifications.rb:166:in instrument' /usr/lib/ruby/vendor_ruby/rails/engine.rb:651:in load_config_initializer'
/usr/lib/ruby/vendor_ruby/rails/engine.rb:616:in block (2 levels) in <class:Engine>' /usr/lib/ruby/vendor_ruby/rails/engine.rb:615:in each'
/usr/lib/ruby/vendor_ruby/rails/engine.rb:615:in block in <class:Engine>' /usr/lib/ruby/vendor_ruby/rails/initializable.rb:30:in instance_exec'
/usr/lib/ruby/vendor_ruby/rails/initializable.rb:30:in run' /usr/lib/ruby/vendor_ruby/rails/initializable.rb:55:in block in run_initializers'
/usr/lib/ruby/2.5.0/tsort.rb:228:in block in tsort_each' /usr/lib/ruby/2.5.0/tsort.rb:350:in block (2 levels) in each_strongly_connected_component'
/usr/lib/ruby/2.5.0/tsort.rb:422:in block (2 levels) in each_strongly_connected_component_from' /usr/lib/ruby/2.5.0/tsort.rb:431:in each_strongly_connected_component_from'
/usr/lib/ruby/2.5.0/tsort.rb:421:in block in each_strongly_connected_component_from' /usr/lib/ruby/vendor_ruby/rails/initializable.rb:44:in each'
/usr/lib/ruby/vendor_ruby/rails/initializable.rb:44:in tsort_each_child' /usr/lib/ruby/2.5.0/tsort.rb:415:in call'
/usr/lib/ruby/2.5.0/tsort.rb:415:in each_strongly_connected_component_from' /usr/lib/ruby/2.5.0/tsort.rb:349:in block in each_strongly_connected_component'
/usr/lib/ruby/2.5.0/tsort.rb:347:in each' /usr/lib/ruby/2.5.0/tsort.rb:347:in call'
/usr/lib/ruby/2.5.0/tsort.rb:347:in each_strongly_connected_component' /usr/lib/ruby/2.5.0/tsort.rb:226:in tsort_each'
/usr/lib/ruby/2.5.0/tsort.rb:205:in tsort_each' /usr/lib/ruby/vendor_ruby/rails/initializable.rb:54:in run_initializers'
/usr/lib/ruby/vendor_ruby/rails/application.rb:352:in initialize!' /usr/share/redmine/config/environment.rb:14:in <top (required)>'
/usr/lib/ruby/vendor_ruby/rails/application.rb:328:in require' /usr/lib/ruby/vendor_ruby/rails/application.rb:328:in require_environment!'
/usr/lib/ruby/vendor_ruby/rails/application.rb:457:in block in run_tasks_blocks' /var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:273:in block in execute'
/var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:273:in each' /var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:273:in execute'
/var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:214:in block in invoke_with_call_chain' /usr/lib/ruby/2.5.0/monitor.rb:226:in mon_synchronize'
/var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:194:in invoke_with_call_chain' /var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:238:in block in invoke_prerequisites'
/var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:236:in each' /var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:236:in invoke_prerequisites'
/var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:213:in block in invoke_with_call_chain' /usr/lib/ruby/2.5.0/monitor.rb:226:in mon_synchronize'
/var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:194:in invoke_with_call_chain' /var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:183:in invoke'
/usr/share/redmine/lib/tasks/redmine.rake:57:in block (2 levels) in <top (required)>' /var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:273:in block in execute'
/var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:273:in each' /var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:273:in execute'
/var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:214:in block in invoke_with_call_chain' /usr/lib/ruby/2.5.0/monitor.rb:226:in mon_synchronize'
/var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:194:in invoke_with_call_chain' /var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:183:in invoke'
/var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:160:in invoke_task' /var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:116:in block (2 levels) in top_level'
/var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:116:in each' /var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:116:in block in top_level'
/var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:125:in run_with_threads' /var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:110:in top_level'
/var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:83:in block in run' /var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:186:in standard_exception_handling'
/var/lib/gems/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:80:in run' /var/lib/gems/2.5.0/gems/rake-12.3.2/exe/rake:27:in <top (required)>'
/usr/local/bin/rake:23:in load' /usr/local/bin/rake:23:in <top (required)>'
/var/lib/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in load' /var/lib/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in kernel_load'
/var/lib/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:28:in run' /var/lib/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/cli.rb:463:in exec'
/var/lib/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in run' /var/lib/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in invoke_command'
/var/lib/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor.rb:387:in dispatch' /var/lib/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/cli.rb:27:in dispatch'
/var/lib/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/base.rb:466:in start' /var/lib/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/cli.rb:18:in start'
/var/lib/gems/2.5.0/gems/bundler-1.17.3/exe/bundle:30:in block in <top (required)>' /var/lib/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/friendly_errors.rb:124:in with_friendly_errors'
/var/lib/gems/2.5.0/gems/bundler-1.17.3/exe/bundle:22:in <top (required)>' /usr/local/bin/bundle:23:in load'
/usr/local/bin/bundle:23:in `

'

Support of on-the-fly registration

Hi,

I need a on-the-fly registration, it seems that you don't have the time to do it, so, can you give me some hints to make it?

Thanks by advance.

Plugin works fine with Redmine 3.1.0

Works fine with:
Environment:
Redmine version 3.1.0.stable
Ruby version 2.1.2-p95 (2014-05-08) [x86_64-linux]
Rails version 4.2.3
Environment production
Database adapter PostgreSQL
SCM:
Subversion 1.6.17
Git 1.7.10.4
Filesystem

NoMethodError raise Error 500

Here's Redmine Log:

Started GET "/login?back_url=https%3A%2F%2Fdi.wsb.poznan.pl%2F" for 150.254.194.88 at Fri Mar 01 03:41:40 -0500 2013
Processing by AccountController#login as HTML
Parameters: {"back_url"=>"https://di.wsb.poznan.pl/"}
Current user: anonymous
Redirected to https://di.wsb.poznan.pl/auth/cas?origin=https%3A%2F%2Fdi.wsb.poznan.pl%2F
Completed 302 Found in 38ms (ActiveRecord: 1.8ms)
Started GET "/auth/cas?origin=https%3A%2F%2Fdi.wsb.poznan.pl%2F" for 150.254.194.88 at Fri Mar 01 03:41:40 -0500 2013
Started GET "/auth/cas/callback?origin=https%3A%2F%2Fdi.wsb.poznan.pl%2F&ticket=ST-1901879-1BFUaiUNKIxWtaojgzsg-cas" for 150.254.194.88 at Fri Mar 01 03:41:48 -0500 2013
Processing by AccountController#login_with_cas_callback as HTML
Parameters: {"origin"=>"https://di.wsb.poznan.pl/", "provider"=>"cas", "ticket"=>"ST-1901879-1BFUaiUNKIxWtaojgzsg-cas"}
Current user: anonymous
Successful authentication for 'a_poznan' from 150.254.194.88 at Fri Mar 01 08:41:49 UTC 2013
Redirected to https://di.wsb.poznan.pl/
Completed 302 Found in 59ms (ActiveRecord: 22.3ms)

NoMethodError (undefined method options' for #<Hash:0x7fcfe626cbf0>): rack (1.5.2) lib/rack/session/abstract/id.rb:329:incommit_session'
rack (1.5.2) lib/rack/session/abstract/id.rb:226:in context' rack (1.5.2) lib/rack/session/abstract/id.rb:220:incall'
/usr/lib/ruby/vendor_ruby/action_dispatch/middleware/cookies.rb:341:in call' /usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:64:incall'
/usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb:479:in call' /usr/lib/ruby/vendor_ruby/action_dispatch/middleware/callbacks.rb:28:incall'
/usr/lib/ruby/vendor_ruby/active_support/callbacks.rb:405:in _run__1252210014__call__4__callbacks' /usr/lib/ruby/vendor_ruby/active_support/callbacks.rb:405:insend'
/usr/lib/ruby/vendor_ruby/active_support/callbacks.rb:405:in __run_callback' /usr/lib/ruby/vendor_ruby/active_support/callbacks.rb:385:in_run_call_callbacks'
/usr/lib/ruby/vendor_ruby/active_support/callbacks.rb:81:in send' /usr/lib/ruby/vendor_ruby/active_support/callbacks.rb:81:inrun_callbacks'
/usr/lib/ruby/vendor_ruby/action_dispatch/middleware/callbacks.rb:27:in call' /usr/lib/ruby/vendor_ruby/action_dispatch/middleware/remote_ip.rb:31:incall'
/usr/lib/ruby/vendor_ruby/action_dispatch/middleware/debug_exceptions.rb:16:in call' /usr/lib/ruby/vendor_ruby/action_dispatch/middleware/show_exceptions.rb:56:incall'
/usr/lib/ruby/vendor_ruby/rails/rack/logger.rb:32:in call_app' /usr/lib/ruby/vendor_ruby/rails/rack/logger.rb:16:incall'
/usr/lib/ruby/vendor_ruby/active_support/tagged_logging.rb:22:in tagged' /usr/lib/ruby/vendor_ruby/rails/rack/logger.rb:16:incall'
/usr/lib/ruby/vendor_ruby/action_dispatch/middleware/request_id.rb:22:in call' rack (1.5.2) lib/rack/methodoverride.rb:21:incall'
rack (1.5.2) lib/rack/runtime.rb:17:in call' /usr/lib/ruby/vendor_ruby/active_support/cache/strategy/local_cache.rb:72:incall'
rack (1.5.2) lib/rack/lock.rb:17:in call' /usr/lib/ruby/vendor_ruby/action_dispatch/middleware/static.rb:62:incall'
/usr/lib/ruby/vendor_ruby/rack/cache/context.rb:136:in forward' /usr/lib/ruby/vendor_ruby/rack/cache/context.rb:245:infetch'
/usr/lib/ruby/vendor_ruby/rack/cache/context.rb:185:in lookup' /usr/lib/ruby/vendor_ruby/rack/cache/context.rb:66:incall!'
/usr/lib/ruby/vendor_ruby/rack/cache/context.rb:51:in call' /usr/lib/ruby/vendor_ruby/rails/engine.rb:479:incall'
/usr/lib/ruby/vendor_ruby/rails/application.rb:223:in call' /usr/lib/ruby/vendor_ruby/rails/railtie/configurable.rb:30:insend'
/usr/lib/ruby/vendor_ruby/rails/railtie/configurable.rb:30:in method_missing' /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/request_handler.rb:96:inprocess_request'
/usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_request_handler.rb:516:in accept_and_process_next_request' /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_request_handler.rb:274:inmain_loop'
/usr/lib/ruby/vendor_ruby/phusion_passenger/classic_rails/application_spawner.rb:321:in start_request_handler' /usr/lib/ruby/vendor_ruby/phusion_passenger/classic_rails/application_spawner.rb:275:insend'
/usr/lib/ruby/vendor_ruby/phusion_passenger/classic_rails/application_spawner.rb:275:in handle_spawn_application' /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:479:insafe_fork'
/usr/lib/ruby/vendor_ruby/phusion_passenger/classic_rails/application_spawner.rb:270:in handle_spawn_application' /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:357:insend'
/usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:357:in server_main_loop' /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:206:instart_synchronously'
/usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:180:in start' /usr/lib/ruby/vendor_ruby/phusion_passenger/classic_rails/application_spawner.rb:149:instart'
/usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:219:in spawn_rails_application' /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server_collection.rb:132:inlookup_or_add'
/usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:214:in spawn_rails_application' /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server_collection.rb:82:insynchronize'
/usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server_collection.rb:79:in synchronize' /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:213:inspawn_rails_application'
/usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:132:in spawn_application' /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:275:inhandle_spawn_application'
/usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:357:in __send__' /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:357:inserver_main_loop'
/usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/usr/share/phusion-passenger/helper-scripts/passenger-spawn-server:99

Serwer url: https://portal.wsb.pl/cas
Validate link: blank
CAS version 2

Environment:
Redmine version 2.2.3.stable
Ruby version 1.8.7 (x86_64-linux)
Rails version 3.2.12
Environment production
Database adapter PostgreSQL
Redmine plugins:
redmine_omniauth_cas 0.1.1

Everything's fine except Redmine throws NoMethodError options... How fix it?

NoMethodError (undefined method `+' for nil:NilClass)

I have Redmine 2.1.3 installed under ubuntu 12.04 LTS. I have followe installation instructions for the plugin and everything worked well (the only thing bothers me is that "RAILS_ENV=production rake redmine:plugins" does not shown any migrations for the plugin.
Anyway after clicking "Login with CAS" apllication gives an internal error which starts in production .log with statement "RAILS_ENV=production rake redmine:plugins"

Internal error during CAS auth

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

GitHub authentication fails

I'm trying to set up login using a GitHub Enterprise account on Redmine 2.3.3. Here's what I did so far:

  1. Registered a new app at my GitHub Enterprise installation, using /auth/github/callback as the callback URL.
  2. Cloned redmine_omniauth_cas into the plugins folder.
  3. Edited init.rb to reflect omniauth-github's boilerplate code for GitHub Enterprise.
  4. Added omniauth-github to Gemfile.local.
  5. bundle update
  6. Created an account with the same login as my GitHub Enterprise account.
  7. Manually browsed to /auth/github, which threw me to GitHub's authorization page, as expected.
  8. Authorized the app.

Unfortunately, this kicked me back to the (standard) login page, with the error message translation missing: en.error_cas_invalid_credentials. Digging into the logs, I found redirects to /auth/github/callback?error=redirect_uri_mismatch&state=....

I subsequently found that I can override the redirect URI using the origin HTTP parameter, so I browsed to /auth/github?origin=http://.... I take it there's a better way to access this URL?

Anyway, after authorization, I ended up at the Redmine login page again, but with a different error: Invalid user or password. In the logs, I found Failed login for '673'. I have no idea where that 673 comes from. It's not the numeric ID of my Redmine account. I guess it might be my ID at the GitHub Enterprise installation, which uses LDAP logins, but why would GitHub resort to the numeric version rather than my user name?

So now, I'm pretty much stuck. Any help is appreciated. I apologize if this is an omniauth-github issue instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.