-
Notifications
You must be signed in to change notification settings - Fork 645
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
Conversation
@@ -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)) |
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.
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.
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.
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. |
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.
were you able to find out why the SignIn.UserNameOrEmail
was empty even though the controller set its value in the model?
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.
When you submit the form and the submission fails, SignIn.UserNameOrEmail
is not set.
#5441
#5436
And also fixed a NPE for when the user has an old AAD credential without a tenant ID.