diff --git a/Gemfile b/Gemfile
index f3d7d470a..5da67e1a5 100644
--- a/Gemfile
+++ b/Gemfile
@@ -34,12 +34,6 @@ group :ldap do
gem 'net-ldap', '~> 0.17.0'
end
-# Optional gem for OpenID authentication
-group :openid do
- gem "ruby-openid", "~> 2.9.2", :require => "openid"
- gem "rack-openid"
-end
-
# Optional gem for exporting the gantt to a PNG file
group :minimagick do
gem 'mini_magick', '~> 4.11.0'
diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb
index e1b3d4f2b..a55375539 100644
--- a/app/controllers/account_controller.rb
+++ b/app/controllers/account_controller.rb
@@ -27,14 +27,6 @@ class AccountController < ApplicationController
skip_before_action :check_if_login_required, :check_password_change
skip_before_action :check_twofa_activation, :only => :logout
- # Overrides ApplicationController#verify_authenticity_token to disable
- # token verification on openid callbacks
- def verify_authenticity_token
- unless using_open_id?
- super
- end
- end
-
# Login request and validation
def login
if request.post?
@@ -161,7 +153,7 @@ class AccountController < ApplicationController
redirect_to my_account_path
end
else
- unless user_params[:identity_url].present? && user_params[:password].blank? && user_params[:password_confirmation].blank?
+ unless user_params[:password].blank? && user_params[:password_confirmation].blank?
@user.password, @user.password_confirmation = user_params[:password], user_params[:password_confirmation]
end
@@ -301,11 +293,7 @@ class AccountController < ApplicationController
end
def authenticate_user
- if Setting.openid? && using_open_id?
- open_id_authenticate(params[:openid_url])
- else
- password_authentication
- end
+ password_authentication
end
def password_authentication
@@ -339,49 +327,6 @@ class AccountController < ApplicationController
update_sudo_timestamp! # activate Sudo Mode
end
- def open_id_authenticate(openid_url)
- back_url = signin_url(:autologin => params[:autologin])
- authenticate_with_open_id(
- openid_url, :required => [:nickname, :fullname, :email],
- :return_to => back_url, :method => :post
- ) do |result, identity_url, registration|
- if result.successful?
- user = User.find_or_initialize_by_identity_url(identity_url)
- if user.new_record?
- # Self-registration off
- (redirect_to(home_url); return) unless Setting.self_registration?
- # Create on the fly
- user.login = registration['nickname'] unless registration['nickname'].nil?
- user.mail = registration['email'] unless registration['email'].nil?
- user.firstname, user.lastname = registration['fullname'].split(' ') unless registration['fullname'].nil?
- user.random_password
- user.register
- case Setting.self_registration
- when '1'
- register_by_email_activation(user) do
- onthefly_creation_failed(user)
- end
- when '3'
- register_automatically(user) do
- onthefly_creation_failed(user)
- end
- else
- register_manually_by_administrator(user) do
- onthefly_creation_failed(user)
- end
- end
- else
- # Existing record
- if user.active?
- successful_authentication(user)
- else
- handle_inactive_user(user)
- end
- end
- end
- end
- end
-
def successful_authentication(user)
logger.info "Successful authentication for '#{user.login}' from #{request.remote_ip} at #{Time.now.utc}"
# Valid user
diff --git a/app/models/setting.rb b/app/models/setting.rb
index 096833056..e7cfdfb2b 100644
--- a/app/models/setting.rb
+++ b/app/models/setting.rb
@@ -268,10 +268,6 @@ class Setting < ActiveRecord::Base
a
end
- def self.openid?
- Object.const_defined?(:OpenID) && self[:openid].to_i > 0
- end
-
# Checks if settings have changed since the values were read
# and clears the cache hash if it's the case
# Called once per request
diff --git a/app/models/user.rb b/app/models/user.rb
index 681829265..9c8e0f02a 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -111,7 +111,6 @@ class User < Principal
validates_format_of :login, :with => /\A[a-z0-9_\-@\.]*\z/i
validates_length_of :login, :maximum => LOGIN_LENGTH_LIMIT
validates_length_of :firstname, :lastname, :maximum => 30
- validates_length_of :identity_url, maximum: 255
validates_inclusion_of :mail_notification, :in => MAIL_NOTIFICATION_OPTIONS.collect(&:first), :allow_blank => true
Setting::PASSWORD_CHAR_CLASSES.each do |k, v|
validates_format_of :password, :with => v, :message => :"must_contain_#{k}", :allow_blank => true, :if => Proc.new {Setting.password_required_char_classes.include?(k)}
@@ -198,28 +197,6 @@ class User < Principal
email_addresses.pluck(:address)
end
- def self.find_or_initialize_by_identity_url(url)
- user = where(:identity_url => url).first
- unless user
- user = User.new
- user.identity_url = url
- end
- user
- end
-
- def identity_url=(url)
- if url.blank?
- write_attribute(:identity_url, '')
- else
- begin
- write_attribute(:identity_url, OpenIdAuthentication.normalize_identifier(url))
- rescue OpenIdAuthentication::InvalidOpenId
- # Invalid url, don't save
- end
- end
- self.read_attribute(:identity_url)
- end
-
# Returns the user that matches provided login and password, or nil
# AuthSource errors are caught, logged and nil is returned.
def self.try_to_login(login, password, active_only=true)
@@ -800,8 +777,7 @@ class User < Principal
'notified_project_ids',
'language',
'custom_field_values',
- 'custom_fields',
- 'identity_url')
+ 'custom_fields')
safe_attributes(
'login',
:if => lambda {|user, current_user| user.new_record?})
diff --git a/app/views/account/login.html.erb b/app/views/account/login.html.erb
index 1440e3227..38991ae60 100644
--- a/app/views/account/login.html.erb
+++ b/app/views/account/login.html.erb
@@ -13,11 +13,6 @@
<%= password_field_tag 'password', nil, :tabindex => '2' %>
- <% if Setting.openid? %>
-
- <%= text_field_tag "openid_url", nil, :tabindex => '3' %>
- <% end %>
-
<% if Setting.autologin? %>
<% end %>
diff --git a/app/views/account/register.html.erb b/app/views/account/register.html.erb
index f35e0e0cc..05f2315ff 100644
--- a/app/views/account/register.html.erb
+++ b/app/views/account/register.html.erb
@@ -1,4 +1,4 @@
-
<%=l(:label_register)%> <%=link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %>
+<%=l(:label_register)%>
<%= labelled_form_for @user, :url => register_path do |f| %>
<%= error_messages_for 'user' %>
@@ -28,10 +28,6 @@
<%= f.select :language, lang_options_for_select %>
<% end %>
-<% if Setting.openid? %>
- <%= f.text_field :identity_url %>
-<% end %>
-
<% @user.custom_field_values.select {|v| (Setting.show_custom_fields_on_registration? && v.editable?) || v.required?}.each do |value| %>
<%= custom_field_tag_with_label :user, value %>
<% end %>
diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb
index c54183a8c..fc27dc61c 100644
--- a/app/views/my/account.html.erb
+++ b/app/views/my/account.html.erb
@@ -25,9 +25,6 @@
<% unless @user.force_default_language? %>
<%= f.select :language, lang_options_for_select %>
<% end %>
- <% if Setting.openid? %>
- <%= f.text_field :identity_url %>
- <% end %>
<% if Setting.twofa? -%>
diff --git a/app/views/settings/_authentication.html.erb b/app/views/settings/_authentication.html.erb
index 9fd0ef646..03c15b92a 100644
--- a/app/views/settings/_authentication.html.erb
+++ b/app/views/settings/_authentication.html.erb
@@ -40,9 +40,6 @@
-<%= setting_check_box :openid, :disabled => !Object.const_defined?(:OpenID) %>
-
-