ee/lib/ee/gitlab/auth/ldap/access.rb
# Update user Kerberos identity with Kerberos principal name from Active Directory
Update user Kerberos identity with Kerberos principal name from Active Directory
Update user Kerberos identity with Kerberos principal name from Active Directory
def update_kerberos_identity
            return unless ldap_user.kerberos_principal.present?
            kerberos_identity = user.identities.where(provider: :kerberos).first
            return if kerberos_identity && kerberos_identity.extern_uid == ldap_user.kerberos_principal
            kerberos_identity ||= ::Identity.new(provider: :kerberos, user: user)
            kerberos_identity.extern_uid = ldap_user.kerberos_principal
            unless kerberos_identity.save
              ::Rails.logger.error "#{self.class.name}: failed to add Kerberos principal #{principal} to #{user.name} (#{user.id})\n"\
                "error messages: #{new_identity.errors.messages}"
            end
          end
def update_kerberos_identity return unless ldap_user . kerberos_principal . present? kerberos_identity = user . identities . where ( provider : :kerberos ) . first return if kerberos_identity && kerberos_identity . extern_uid == ldap_user . kerberos_principal kerberos_identity ||= :: Identity . new ( provider : :kerberos , user : user ) kerberos_identity . extern_uid = ldap_user . kerberos_principal unless kerberos_identity . save :: Rails . logger . error "#{self.class.name}: failed to add Kerberos principal #{principal} to #{user.name} (#{user.id})\n" "error messages: #{new_identity.errors.messages}" end end
Update user Kerberos identity with Kerberos principal name from Active Directory
Update user Kerberos identity with Kerberos principal name from Active Directory
# there can be only one Kerberos identity in GitLab; if the user has a Kerberos identity in AD, # replace any existing Kerberos identity for the user