Project

General

Profile

SAML Plugin for Redmine 5.0

Added by Nipun Tharuka over 1 year ago

Hi All,

I'm a bit new to this forum and I would like to know if there is any SAML plugin for Redmine 5.0? I have tried this https://github.com/chrodriguez/redmine_omniauth_saml but it gives an error while trying to install.

This is the error I'm getting.

RAILS_ENV=production bundle exec rake redmine:plugins
(in /opt/redmine)
rake aborted!
LoadError: cannot load such file -- redmine_omniauth_saml
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/zeitwerk-2.6.7/lib/zeitwerk/kernel.rb:38:in `require'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/zeitwerk-2.6.7/lib/zeitwerk/kernel.rb:38:in `require'
/opt/redmine/plugins/redmine_omniauth_saml/init.rb:2:in `<top (required)>'
/opt/redmine/lib/redmine/plugin_loader.rb:31:in `load'
/opt/redmine/lib/redmine/plugin_loader.rb:31:in `run_initializer'
/opt/redmine/lib/redmine/plugin_loader.rb:108:in `each'
/opt/redmine/lib/redmine/plugin_loader.rb:108:in `block in load'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb:427:in `instance_exec'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb:427:in `block in make_lambda'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb:198:in `block (2 levels) in halting'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb:604:in `block (2 levels) in default_terminator'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb:603:in `catch'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb:603:in `block in default_terminator'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb:199:in `block in halting'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb:512:in `block in invoke_before'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb:512:in `each'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb:512:in `invoke_before'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb:105:in `run_callbacks'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.4.7/lib/active_support/reloader.rb:88:in `prepare!'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/railties-6.1.4.7/lib/rails/application/finisher.rb:124:in `block in <module:Finisher>'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/railties-6.1.4.7/lib/rails/initializable.rb:32:in `instance_exec'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/railties-6.1.4.7/lib/rails/initializable.rb:32:in `run'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/railties-6.1.4.7/lib/rails/initializable.rb:61:in `block in run_initializers'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/railties-6.1.4.7/lib/rails/initializable.rb:60:in `run_initializers'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/railties-6.1.4.7/lib/rails/application.rb:391:in `initialize!'
/opt/redmine/config/environment.rb:16:in `<top (required)>'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/zeitwerk-2.6.7/lib/zeitwerk/kernel.rb:38:in `require'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/zeitwerk-2.6.7/lib/zeitwerk/kernel.rb:38:in `require'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:332:in `block in require'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:299:in `load_dependency'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.4.7/lib/active_support/dependencies.rb:332:in `require'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/railties-6.1.4.7/lib/rails/application.rb:367:in `require_environment!'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/railties-6.1.4.7/lib/rails/application.rb:533:in `block in run_tasks_blocks'
/opt/redmine/lib/tasks/redmine.rake:73:in `block (2 levels) in <top (required)>'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
Tasks: TOP => redmine:plugins:migrate => environment
(See full trace by running task with --trace)

Realy appreciated any support on this..

Thanks.


Replies (1)

RE: SAML Plugin for Redmine 5.0 - Added by Nicolas Metters about 1 year ago

Hi

Dupplicate of #68351

Late reply but for whoever is looking for information:
  • The error "LoadError: cannot load such file -- redmine_omniauth_saml" is probably from a change in syntax in the way init.rb calls files

<quote>require 'redmine'
require 'redmine_omniauth_saml'
require 'redmine_omniauth_saml/hooks'
require 'redmine_omniauth_saml/user_patch'
</quote>

For it to work with Redmine 5.XX, it must be updated to the new format such as:
<quote>require 'redmine'
require File.expand_path('redmine_omniauth_saml', dir)
</quote>

This will load the DIRectory so includes all 3 lines "require 'redmine_omniauth_saml"

For whoever it could interrest: I've documented the SAML plugin configuration in Redmine 5.0.5 using Keycloak v22
https://www.nicksopenworld.com/configure-redmine-sso-with-keycloak-using-saml/

    (1-1/1)