kontron / redmine_oauth

Redmine authentication through OAuth.
GNU General Public License v2.0
51 stars 25 forks source link

Is it possible to hide the normal login/password prompt through config when a instance just needs OAuth login #28

Closed srsree closed 4 months ago

srsree commented 5 months ago

In few use cases, once OAuth is enabled and configured, login/ password prompts are no longer relevant. Is it possible to allow an option in setup to disable showing the login/password prompts?

The default approach needs us to tamper with code or write a wrapper.

col-panic commented 4 months ago

Is there any plan on implementing this feature? Unfortunately I'm not a ruby developer, but I could assist in testing the plugin! Thanks

picman commented 4 months ago

So, please test the devel branch. There is a new option to hide the login form in plugin's settings.

col-panic commented 4 months ago

Thank you, I'll try - at the moment I'm having a problem with

In Gemfile:
  oauth2 was resolved to 2.0.9, which depends on
    multi_xml was resolved to 0.7.1, which depends on
      bigdecimal

where the native compilation fails

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /usr/local/bundle/gems/bigdecimal-3.1.7/ext/bigdecimal
/usr/local/bin/ruby extconf.rb
checking for __builtin_clz()... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

I'm using https://hub.docker.com/_/redmine#5.1 guess I'll have to open an issue on that ...

srsree commented 4 months ago

Sure. Will try.

Regards, sree

Sreekanth S Rameshaiah Executive Director Mahiti +91-98455-12611 http://mahiti.org On 6 May 2024 at 1:18 PM +0530, Karel Pičman @.***>, wrote:

So, please test the devel branch. There is a new option to hide the login form in plugin's settings. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

col-panic commented 4 months ago

The error exists since multi_xml 0.7.0 https://rubygems.org/gems/multi_xml/versions/0.7.0, prior to this there was no dependency to bigdecimal. This is really a pain and led to https://github.com/docker-library/redmine/discussions/328

col-panic commented 4 months ago

This looks good - thank you very much! I see that the login form is not visible anymore, and I could successfully login using keycloak and no password form was shown. After some first test the following points come into question:

picman commented 4 months ago

Add 1) I've added there a collapsible login form. In case of need a user can click on the arrow and will see the normal login form. What do you think about it?

image

Add the rest) Please create dedicated issues fir each problem otherwise it is unmanageable.

col-panic commented 4 months ago

Add 1) I've added there a collapsible login form. In case of need a user can click on the arrow and will see the normal login form. What do you think about it?

image

Add the rest) Please create dedicated issues fir each problem otherwise it is unmanageable.

I think this depends on https://github.com/kontron/redmine_oauth/issues/30 and https://github.com/kontron/redmine_oauth/issues/32. Another option would be to offer a route like https://my.redmine.info?login_method=userpass to enforce login via a specific method. I don't know however if such is route can be done via a plugin.

col-panic commented 4 months ago

It might be also sufficient (as this is a "problem only" solution) to document the ruby call to unset the option. So that if there is a persistent problem logging in using oauth2, the system administrator may use an operating system call to re-activate password login. I am not sure, where redmine stores configuration, but it might also be enough to document on how to re-activate password login via an SQL parameter!

picman commented 4 months ago

I consider the original request as solved. For other requests, please create dedicated issues for each problem.