Skip to content
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

Email exists but the database does not get populated #36

Closed
thehackerish opened this issue May 24, 2023 · 5 comments
Closed

Email exists but the database does not get populated #36

thehackerish opened this issue May 24, 2023 · 5 comments

Comments

@thehackerish
Copy link

I am using the Teams technique in TeamFiltration. Using the Debug option, I see that some emails return a valid TenantId and that the email is valid and found in many attributes in the JSON response. However, the UserPrincipalName does not match the username, but the givenName matches the email.

Here is an example for the username d.bauer@redacted.com. I anonymized all the data.

[{"tenantId":"REDACTED","isShortProfile":false,"accountEnabled":true,"featureSettings":{"coExistenceMode":"TeamsOnly"},"userPrincipalName":"d19@redacted.com","givenName":"d.bauer@redacted.com","surname":"","email":"d19@redacted.com","tenantName":"REDACTED","displayName":"Dave Bauer","type":"Federated","mri":"8:orgid:REDACTED","objectId":"REDACTED"}]

I was wondering why do you check that the UserPrincipalName should be equal to the email in this line:

&& responeObject.FirstOrDefault().userPrincipalName.ToLower().Equals(username.ToLower())

@Flangvik
Copy link
Owner

Flangvik commented May 24, 2023

This is a good find 👍👍Just what I wanted when releasing this (it being used against more clients, thus seeing more tenant configs and edge cases). Thinking the best approach would be to merge those into an or statement, comparing both the givenName and userPrincipalName properties to the username.

Also 10+ points for using the debug feature ;)

@thehackerish
Copy link
Author

Perfect! I will add a pull request considering what I have in my tests. The approach would be to look for the email in all attributes of the objects in the list returned and store it if it matches any.

@AntonyBwana
Copy link

In my case I was using the MSOL module. I realised that the emails that have been verified aren't being stored.

@sadpotatos123
Copy link

In my case I was using the MSOL module. I realised that the emails that have been verified aren't being stored.

I had the same problem when using --validate-msol.

@Flangvik
Copy link
Owner

Flangvik commented Aug 3, 2023

@Flangvik Flangvik closed this as completed Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants