thank you for pointing that out. The linked plugin has not been released yet, therefore I removed the links.
Instead I have linked a small example plugin which can be used as orientation as well.
~ Markus
P.S.
The openproject-openid_connect plugin will likely be released within the next weeks, though.
I try it in local. I installed in openproject 3.0.3 core but it create error:
Could seems order of dependencies openproject-plugin and openproject-mock in local ?
cannot load such file — open_project/plugins (LoadError)
/home/openproject/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:251:in `require’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:251:in `block in require’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:236:in `load_dependency’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:251:in `require’
/home/openproject/RubymineProjects/openproject-mock_auth/lib/open_project/mock_auth/engine.rb:3:in `<top (required)>’
you are right, the plugin depends on the OpenProject plugins plugin. I’ve updated the readme to reflect that.
Could please insert the following line into your `Gemfile.plugins`?
Apologize for the inconvenience… with openproject 3.0.3 all configured and tested ok. And ruby 2.1.0.0p0.
OpenProject throw error above plugin openproject-mock_auth:
sorry for the late reply. Tomorrow I should be able to get back to you quicker.
It looks like OmniAuth is not loaded. Did you run `bundle install`? You shouldn’t have to declare it explicitly in the Gemfile since it is defined as a dependency in the gemspec.
That being said, the gemspec of the mock plugin was sort of broken up until today … I now fixed it, though.
Also I now explicitly require ‘omniauth/strategy’.
Could please try to pull (master) of mock auth again and do a `bundle install`?
Also may I ask what your actual goal is? Do you aim to write your own authentication plugin?
We will release an “AuthPlugins plugin” very soon (probably tomorrow) that will make that quite a bit easier.
Oh, I just realised that this won’t work with OpenProject 3.0.3 because it hasn’t got OmniAuth support yet. We still have to release a stable branch which includes that.
Until then you’re gonna have to use the dev branch for the core. Then it should work!
I’m working on releasing the `openproject-auth_plugins` plugin today. I will get back to you once it’s released.
the auth_plugins plugin [1] is now released and you could it to make building your own auth plugin a little bit easier.
Remember that, for the time being, you will have to use OpenProject’s dev branch (i.e. not version 3.0.3) for it to work.
Excuse me because I’m not a member and I cannot add bugs in core OP4.0. I sent today email to openproject.
I try to install OP4.0 in the same server. I create one directory and inside I executed “git clone https://github.com/opf/openproject.git .” I copied old OP3.0 configuration.yml. I modified database.yml to use new databases openproject_dev4, openproject_prod4, openproject_test4. And bundle install (all in the same directory)
Application throw a error: (Another time is dependencies of Omniauth…)
openproject@eventuoc:~/openproject4$ bundle exec rake db:migrate
require ‘rails/all’… 0.970s
Bundler.require… 3.390s
DEPRECATION WARNING: Deprecated mail delivery settings used. Please update them in config/configuration.yml or use environment variables. See doc/CONFIGURATION.md for more information. (called from convert_old_email_settings at /home/openproject/openproject4/lib/open_project/configuration.rb:191)
Application.initialize!… [deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
rake aborted!
NameError: uninitialized constant OmniAuth
/home/openproject/openproject4/config/initializers/omniauth.rb:1:in `<top (required)>’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/engine.rb:593:in `block (2 levels) in class:Engine’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/engine.rb:592:in `each’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/engine.rb:592:in `block in class:Engine’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/initializable.rb:30:in `instance_exec’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/initializable.rb:30:in `run’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/initializable.rb:55:in `block in run_initializers’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/initializable.rb:54:in `each’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/initializable.rb:54:in `run_initializers’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/application.rb:136:in `initialize!’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/railtie/configurable.rb:30:in `method_missing’
/home/openproject/openproject4/config/environment.rb:36:in `block in <top (required)>’
/home/openproject/openproject4/config/application.rb:44:in `block in bench’
/home/openproject/openproject4/config/application.rb:43:in `bench’
/home/openproject/openproject4/config/environment.rb:34:in `<top (required)>’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/application.rb:103:in `require_environment!’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/application.rb:305:in `block (2 levels) in initialize_tasks’
/home/openproject/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval’
/home/openproject/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `
’
Tasks: TOP => db:migrate => environment
(See full trace by running task with —trace)
I solve error seems with change inside Gemfile to gem ‘omniauth’, :branch => “dev”. (Same last version). I modified omniauth.rb and save without changes. I install gem omniauth before execute bundle install…
I’m sorry to be generic but I try some configurations. I’m not sure about commands especifics or order.
Before I tried to use require ’omniauth’ inside omniauth.rb. That last option isn’t ok.
not sure what’s not working for you. But I recorded a quick and dirty video tutorial (7 minutes) which goes through every step necessary to fire up a fresh OpenProject instance with the mock authentication plugin locally. Does that work for you?
Replies (12)
Hello Daniel,
thank you for pointing that out. The linked plugin has not been released yet, therefore I removed the links.
Instead I have linked a small example plugin which can be used as orientation as well.
~ Markus
P.S.
The openproject-openid_connect plugin will likely be released within the next weeks, though.
Thank you very much Markus Kahl,
I try it in local. I installed in openproject 3.0.3 core but it create error:
Could seems order of dependencies openproject-plugin and openproject-mock in local ?
cannot load such file — open_project/plugins (LoadError)
/home/openproject/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:251:in `require’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:251:in `block in require’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:236:in `load_dependency’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:251:in `require’
/home/openproject/RubymineProjects/openproject-mock_auth/lib/open_project/mock_auth/engine.rb:3:in `<top (required)>’
Regards,
Hey Daniel,
you are right, the plugin depends on the OpenProject plugins plugin. I’ve updated the readme to reflect that.
Could please insert the following line into your `Gemfile.plugins`?
I also updated the mock auth plugin so you might have to update the gem.
Best,
Markus
Apologize for the inconvenience… with openproject 3.0.3 all configured and tested ok. And ruby 2.1.0.0p0.
OpenProject throw error above plugin openproject-mock_auth:
Error:/home/openproject/.rvm/gems/ruby-2.1.0/bundler/gems/openproject-mock_auth-57513801d94b/lib/omniauth/strategies/mock_auth.rb:10:in `class:MockAuth’: uninitialized constant OmniAuth::Strategy (NameError)
I test in gemspec with command:
a) I declared first command in Gemfile.plugins:
0. gem “openproject-plugins”, :git => “https://github.com/opf/openproject-plugins.git”, :branch => “dev”
b) I proved after next commands:
1. gem ‘openproject-mock_auth’, :git => “https://github.com/machisuji/openproject-mock_auth.git”
2. gem “openproject-mock_auth”, :path => ‘../plugins/openproject-mock_auth’
I proved ok with openproject-meeting. But I don’t know where is solution of integrate openproject-mock_auth
Thank you Markus,
Regards,
Daniel
Hey Daniel,
sorry for the late reply. Tomorrow I should be able to get back to you quicker.
It looks like OmniAuth is not loaded. Did you run `bundle install`? You shouldn’t have to declare it explicitly in the Gemfile since it is defined as a dependency in the gemspec.
That being said, the gemspec of the mock plugin was sort of broken up until today … I now fixed it, though.
Also I now explicitly require ‘omniauth/strategy’.
Could please try to pull (master) of mock auth again and do a `bundle install`?
Also may I ask what your actual goal is? Do you aim to write your own authentication plugin?
We will release an “AuthPlugins plugin” very soon (probably tomorrow) that will make that quite a bit easier.
Best,
Markus
I pull plugin mock again in project OP and bundle install. I receive error that cannot load file omniauth/strategy:
Resume error:
Error:/home/openproject/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:251:in `require’: cannot load such file — omniauth/strategy (LoadError)
I add one file with more detail.
I try to change in gemspec line of dependency of omniauth (dependence broken, could be??):
s.add_runtime_dependency “omniauth” (Same error)
Could be better try explicit omniauth version in gemspec? (Now version is 1.2.1 when I bundle install)
I’m writing my own authentication plugin with generic strategy: intridea/omniauth-oauth2 and university provider’s.
I want to try AuthPlugins, jeje. (I saw your fork AuthPlugins in github)
Regards,
Daniel
Oh, I just realised that this won’t work with OpenProject 3.0.3 because it hasn’t got OmniAuth support yet. We still have to release a stable branch which includes that.
Until then you’re gonna have to use the dev branch for the core. Then it should work!
I’m working on releasing the `openproject-auth_plugins` plugin today. I will get back to you once it’s released.
~ Markus
Hey Daniel,
the auth_plugins plugin [1] is now released and you could it to make building your own auth plugin a little bit easier.
Remember that, for the time being, you will have to use OpenProject’s dev branch (i.e. not version 3.0.3) for it to work.
~ Markus
[1] https://github.com/opf/openproject-auth_plugins
Thank you Markus,
Excuse me because I’m not a member and I cannot add bugs in core OP4.0. I sent today email to openproject.
I try to install OP4.0 in the same server. I create one directory and inside I executed “git clone https://github.com/opf/openproject.git .” I copied old OP3.0 configuration.yml. I modified database.yml to use new databases openproject_dev4, openproject_prod4, openproject_test4. And bundle install (all in the same directory)
When I try to execute:
[openproject@debian]# bundle exec rake db:migrate
[openproject@debian]# RAILS_ENV=“production” bundle exec rake db:seed
Application throw a error: (Another time is dependencies of Omniauth…)
openproject@eventuoc:~/openproject4$ bundle exec rake db:migrate
require ‘rails/all’… 0.970s
Bundler.require… 3.390s
DEPRECATION WARNING: Deprecated mail delivery settings used. Please update them in config/configuration.yml or use environment variables. See doc/CONFIGURATION.md for more information. (called from convert_old_email_settings at /home/openproject/openproject4/lib/open_project/configuration.rb:191)
Application.initialize!… [deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
rake aborted!
NameError: uninitialized constant OmniAuth
/home/openproject/openproject4/config/initializers/omniauth.rb:1:in `<top (required)>’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/engine.rb:593:in `block (2 levels) in class:Engine’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/engine.rb:592:in `each’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/engine.rb:592:in `block in class:Engine’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/initializable.rb:30:in `instance_exec’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/initializable.rb:30:in `run’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/initializable.rb:55:in `block in run_initializers’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/initializable.rb:54:in `each’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/initializable.rb:54:in `run_initializers’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/application.rb:136:in `initialize!’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/railtie/configurable.rb:30:in `method_missing’
/home/openproject/openproject4/config/environment.rb:36:in `block in <top (required)>’
/home/openproject/openproject4/config/application.rb:44:in `block in bench’
/home/openproject/openproject4/config/application.rb:43:in `bench’
/home/openproject/openproject4/config/environment.rb:34:in `<top (required)>’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/application.rb:103:in `require_environment!’
/home/openproject/.rvm/gems/ruby-2.1.0/gems/railties-3.2.18/lib/rails/application.rb:305:in `block (2 levels) in initialize_tasks’
/home/openproject/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval’
/home/openproject/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `
’
Tasks: TOP => db:migrate => environment
(See full trace by running task with —trace)
Regards,
Daniel Bartolomé
I solve error seems with change inside Gemfile to gem ‘omniauth’, :branch => “dev”. (Same last version). I modified omniauth.rb and save without changes. I install gem omniauth before execute bundle install…
I’m sorry to be generic but I try some configurations. I’m not sure about commands especifics or order.
Before I tried to use require ’omniauth’ inside omniauth.rb. That last option isn’t ok.
Regards,
Daniel Bartolomé
Hey Daniel,
not sure what’s not working for you. But I recorded a quick and dirty video tutorial (7 minutes) which goes through every step necessary to fire up a fresh OpenProject instance with the mock authentication plugin locally. Does that work for you?
https://www.youtube.com/watch?v=-Zw4KoLurJA
Best,
Markus
Here’s the video in better quality: http://youtu.be/esCN9razZiE