-
Notifications
You must be signed in to change notification settings - Fork 24
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
Group Augmentation fails with email and AD #22
Comments
This solution works for email but will break every other type.. using (PrincipalContext principalContext = new PrincipalContext(ContextType.Domain, directoryDomainFqdn))
{
using (UserPrincipal user_principal = new UserPrincipal(principalContext) { Enabled = true, EmailAddress = requestInfo.IncomingEntity.Value })
using (PrincipalSearcher user_searcher = new PrincipalSearcher(user_principal))
using (PrincipalSearchResult<Principal> results = user_searcher.FindAll())
{
UserPrincipal adUser = (UserPrincipal)results.First();
if (adUser == null) return groups;
... |
I will investigate this and let you know my findings |
I think you'll find UserPrincipal.FindByIdentity's IdentityType does not support email. https://msdn.microsoft.com/en-us/library/bb356425%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396 |
Thank you for your analysis, you are correct, current implementation doesn't work with emails. |
I published a new release (v2017-10) that fixes this bug. Can you please try it out? |
Closing as I got no feedback from @mrbubble62 |
When requestInfo.IncomingEntity.Value type is email
adUser = UserPrincipal.FindByIdentity(principalContext, requestInfo.IncomingEntity.Value)
FindByIdentity always returns null
The text was updated successfully, but these errors were encountered: