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

Small orgs/AAD bug bash fixes #5482

Merged
merged 2 commits into from
Feb 16, 2018
Merged

Small orgs/AAD bug bash fixes #5482

merged 2 commits into from
Feb 16, 2018

Conversation

scottbommarito
Copy link
Contributor

#5441
#5436

And also fixed a NPE for when the user has an old AAD credential without a tenant ID.

@@ -75,7 +75,7 @@ public override SecurityPolicyResult Evaluate(UserSecurityPolicyEvaluationContex
var targetCredential = targetAccount.Credentials.GetAzureActiveDirectoryCredential();

if (targetCredential == null
|| !targetCredential.TenantId.Equals(state.Tenant, StringComparison.OrdinalIgnoreCase))
|| !state.Tenant.Equals(targetCredential.TenantId, StringComparison.OrdinalIgnoreCase))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometimes, for old AAD, targetCredential.TenantId is null. state.Tenant is guaranteed to be non-null, so we should use that to perform this comparison.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we should populate the tenant ID values, but it would only be the case for admins that is missing.

@@ -66,7 +66,7 @@
else
{
<p class="text-center">
Looks like we don't have an account with this email address (@Model.SignIn.UserNameOrEmail) in our records.
Looks like we don't have an account with this email address (@Model.Register.EmailAddress) in our records.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

were you able to find out why the SignIn.UserNameOrEmail was empty even though the controller set its value in the model?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you submit the form and the submission fails, SignIn.UserNameOrEmail is not set.

@scottbommarito scottbommarito merged commit 81385ef into dev Feb 16, 2018
@scottbommarito scottbommarito deleted the sb-bugbashui branch February 16, 2018 18:47
@scottbommarito scottbommarito restored the sb-bugbashui branch July 22, 2019 23:20
@scottbommarito scottbommarito deleted the sb-bugbashui branch July 22, 2019 23:23
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

Successfully merging this pull request may close these issues.

3 participants