gitlab从8.x升级至11.14后,新用户登录提示422报错,确认为集团CAS做过调整,和通用CAS有区别,需修改cas认证
解决办法:
sed -i '/^ class AuthHash$/i\ require "uri"' /home/gitlab/gitlab/lib/gitlab/auth/o_auth/auth_hash.rb; \ sed -i 's/username_and_email\[:username\]\.to_s/URI.decode(username_and_email[:username].to_s)/' /home/gitlab/gitlab/lib/gitlab/auth/o_auth/auth_hash.rb; \ sed -i 's/username_and_email\[:email\]\.to_s/URI.decode(username_and_email[:email].to_s)/' /home/gitlab/gitlab/lib/gitlab/auth/o_auth/auth_hash.rb; \ sed -i 's/get_info(:name) || "#{get_info(:first_name)} #{get_info(:last_name)}"/URI.decode(get_info(:name) || "#{get_info(:first_name)} #{get_info(:last_name)}")/' /home/gitlab/gitlab/lib/gitlab/auth/o_auth/auth_hash.rb;