-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ldap: make sure realm is set #7690
Conversation
@sumit-bose, I think this can be moved out of draft? |
ec5f63f
to
444db02
Compare
In general the canonical principal will be only set in the cache after a successful authentication because in general it is not know what the canonical principal might be. For Active Directory it is known that the canonical principal is build with the sAMAccountName attribute and the Kerberos realm which is used in the patch "AD: Construct UPN from the sAMAccountName" (7a27e53). If 'id_provider = ldap' is used to access Active Directory the realm might not be set in the internal domain data and as a result a wrong principal might be created. This patch makes sure the realm is set before creating the canonical principal.
444db02
to
bc93bf8
Compare
bc93bf8
to
aa55a38
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test looks good, thank you Sumit.
Hi, please note, tests were written by Madhuri. bye, |
src/tests/system/tests/test_ad.py
Outdated
assert client.auth.parametrize(method).password("user1", "Secret123"), "User user1 failed login!" | ||
|
||
log_str = client.fs.read("/var/log/sssd/krb5_child.log") | ||
assert hasattr(provider.host, "domain"), "Host does not have 'domain' attribute!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this? This is not a step/result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's for the following error,
tests/test_ad.py:70: error: "BaseHost" has no attribute "domain" [attr-defined]
Found 1 error in 1 file (checked 1 source file)
But added a comment at end of line,
assert f"UPN [user1@{provider.host.domain}]" in log_str, f"'UPN [user1@{provider.host.domain}]' not in logs!" # type: ignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments for the test
src/tests/system/tests/test_ad.py
Outdated
client.sssd.nss["override_homedir"] = "/home/%u" | ||
|
||
if isinstance(provider, AD): | ||
dns_parameter = "ad.test" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not seem handle dynamic domain/AD in idmci it can be ad-tb2f.test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
aa55a38
to
40ec63c
Compare
With AD/Samba check the authentication of user by replacing id_provider = ldap Signed-off-by: Madhuri Upadhye <[email protected]>
40ec63c
to
0a2054d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
No description provided.