Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Allow to configure oauth_allow_remapping_of_existing_users via UI

Jan Sandbrink206022005845
diff --git a/app/views/admin/settings/authentication_settings/_sso.html.erb b/app/views/admin/settings/authentication_settings/_sso.html.erb
index 59464c5b64c..8bec979a71b 100644
--- a/app/views/admin/settings/authentication_settings/_sso.html.erb
+++ b/app/views/admin/settings/authentication_settings/_sso.html.erb
@@ -57,6 +57,11 @@ See COPYRIGHT and LICENSE files for more details.
end
end
+ form.check_box(
+ name: :oauth_allow_remapping_of_existing_users,
+ caption: I18n.t("settings.authentication.remapping_existing_users_hint")
+ )
+
form.submit
end
end
diff --git a/config/constants/settings/definition.rb b/config/constants/settings/definition.rb
index fd2375d1f80..a18fd1907cd 100644
--- a/config/constants/settings/definition.rb
+++ b/config/constants/settings/definition.rb
@@ -725,6 +725,7 @@ module Settings
oauth_allow_remapping_of_existing_users: {
description: "When set to false, prevent users from other identity providers to take over accounts " \
"that exist in OpenProject.",
+ format: :boolean,
default: true
},
omniauth_direct_login_provider: {
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 55086b15cb7..e560f266656 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -4044,6 +4044,7 @@ en:
setting_attachment_whitelist: "Attachment upload whitelist"
setting_email_delivery_method: "Email delivery method"
setting_emails_salutation: "Address user in emails with"
+ setting_oauth_allow_remapping_of_existing_users: "Allow remapping of existing users"
setting_sendmail_location: "Location of the sendmail executable"
setting_smtp_enable_starttls_auto: "Automatically use STARTTLS if available"
setting_smtp_ssl: "Use SSL connection"
@@ -4227,6 +4228,10 @@ en:
<br/>
<strong>Note:</strong> Unless you also disable password logins, with this option enabled,
users can still log in internally by visiting the <code>%{internal_path}</code> login page.
+ remapping_existing_users_hint: >
+ If enabled, allows any configured identity provider to login existing users based on their email address,
+ even if the user never signed in through that provider before. This can be useful when migrating the OpenProject instance
+ to a new SSO provider, but is not recommended when using a provider that is not trusted by all users of your instance.
attachments:
whitelist_text_html: >
Define a list of valid file extensions and/or mime types for uploaded files.