Commit e4ffe4b
committed
Use the downcased freeipa principal name, otherwise the provided username
Because sssd supports logins with email or userids by default[1], we need to
ensure we're using the same user for the same backend external auth account,
such as freeipa. In this case, we need to fetch the krbPrincipalName user
attribute or if coming from httpd request headers, the X-REMOTE-USER-PRINCIPAL,
which under the covers also comes from the krbPrincipalName value. This krbPrincipalName
is the backend account name with the kerberos domain and is consistent if you
login with:
first.last@example.com (email)
flast@IPA.test(ipa userid)
flast@ipa.test(case insensitive)
flast(ipa userid without the domain)
Previously, the email login would create a user with username of:
first.last.
Existing username normalization occurs in the authenticate method. Since we're
overriding this behavior in the subclass for systems that have the
krbPrincipalName user attribute or from httpd header with key
X-REMOTE-USER-PRINCIPAL, we need to ensure these values are also normalized or
we could have an existing user created with a downcased userid and a new user
with uppercase characters in the userid.
[1] Logins with either the userid or the email address is a feature of SSSD,
the daemon for central access to the various identity providers in linux.
You can see they updated the documentation to better describe this feature in:
https://issues.redhat.com/browse/RHEL-1654
They released this doc in:
https://access.redhat.com/errata/RHBA-2024:9351
There's a little more found here: https://www.github.com/SSSD/sssd/issues/7136
There is some configuration that can be done to disable this, see the last link.
"If for some reason several users need to share the same email address then set this
option to a nonexistent attribute name in order to disable user lookup/login by email."1 parent 0446227 commit e4ffe4b
File tree
2 files changed
+79
-22
lines changed- app/models/authenticator
- spec/models/authenticator
2 files changed
+79
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
126 | 128 | | |
127 | 129 | | |
128 | 130 | | |
| |||
133 | 135 | | |
134 | 136 | | |
135 | 137 | | |
136 | | - | |
| 138 | + | |
| 139 | + | |
137 | 140 | | |
138 | 141 | | |
139 | 142 | | |
| |||
153 | 156 | | |
154 | 157 | | |
155 | 158 | | |
156 | | - | |
| 159 | + | |
| 160 | + | |
157 | 161 | | |
158 | 162 | | |
159 | 163 | | |
| |||
164 | 168 | | |
165 | 169 | | |
166 | 170 | | |
| 171 | + | |
| 172 | + | |
167 | 173 | | |
168 | 174 | | |
169 | 175 | | |
| |||
173 | 179 | | |
174 | 180 | | |
175 | 181 | | |
| 182 | + | |
176 | 183 | | |
177 | 184 | | |
178 | 185 | | |
| |||
198 | 205 | | |
199 | 206 | | |
200 | 207 | | |
201 | | - | |
| 208 | + | |
202 | 209 | | |
203 | 210 | | |
204 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
104 | 109 | | |
105 | 110 | | |
106 | 111 | | |
| |||
644 | 649 | | |
645 | 650 | | |
646 | 651 | | |
647 | | - | |
| 652 | + | |
648 | 653 | | |
649 | 654 | | |
650 | 655 | | |
| |||
659 | 664 | | |
660 | 665 | | |
661 | 666 | | |
662 | | - | |
663 | | - | |
664 | | - | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
665 | 674 | | |
666 | | - | |
667 | | - | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
668 | 694 | | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
| 695 | + | |
| 696 | + | |
674 | 697 | | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
680 | 703 | | |
681 | | - | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
682 | 710 | | |
683 | | - | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
684 | 734 | | |
685 | 735 | | |
686 | 736 | | |
| |||
0 commit comments