20221213145618_issue4411_setting_saml_custom_uid_attribute.rb 962 B

12345678910111213141516171819202122
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class Issue4411SettingSamlCustomUidAttribute < ActiveRecord::Migration[6.1]
  3. def change
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. saml_setting = Setting.find_by(name: 'auth_saml_credentials')
  7. return if !saml_setting
  8. saml_setting.options[:form].insert(-2, {
  9. display: 'UID Attribute Name',
  10. null: true,
  11. name: 'uid_attribute',
  12. tag: 'input',
  13. placeholder: '',
  14. help: 'Attribute that uniquely identifies the user. If unset, the name identifier returned by the IDP is used.',
  15. })
  16. saml_setting.save!
  17. end
  18. end