-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
IsTfaEnabled #45874
Comments
Triage: It looks like the link that you pasted might be incorrect. Can you clarify what property/method you are wanting to make I assume that you are referring to https://source.dot.net/#Microsoft.AspNetCore.Identity/SignInManager.cs,744. If so, a PR is welcome. |
Hi @cheng93. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
Yes it is, looks like some code was committed which shifted it. Will create a PR |
SummaryChange accessibility of Motivation and goals- private async Task<bool> IsTfaEnabled(TUser user) {}
+ public async Task<bool> IsTwoFactorEnabled(TUser user) {} In scope
Out of scopeScenarios you explicitly want to exclude. Risks / unknownsHow might developers misinterpret/misuse this? How might implementing it restrict us from other enhancements in the future? Also list any perf/security/correctness concerns. Examples// overriding
public override async Task<SignInResult> TwoFactorAuthenticatorSignInAsync(string code, bool isPersistent, bool rememberClient)
{
var user = GetUser()
if (IsTwoFactorEnabled(user)) // here it is called
{
}
} // publicly used
public async Task<IActionResult> OnGet()
{
var user = GetUser();
if (!await signInManager.IsTwoFactorEnabled(user))
{
return RedirectToSetupTwoFactor()
}
} |
So if we are going to make this public, it probably should be a spelled out i.e. |
Thanks for contacting us. We're moving this issue to the |
I can submit PR if given the green light :) |
Sure submit a PR and I'll review it |
Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:
|
I updated the API issue comment and added the label so we can review this while the PR comes in. |
API Review Notes:
API Approved! namespace Microsoft.AspNetCore.Identity;
public class SignInManager<TUser> where TUser : class
{
- private async Task<bool> IsTfaEnabled(TUser user) {}
+ public virtual async Task<bool> IsTwoFactorEnabledAsync(TUser user) {}
} |
https://github.com/dotnet/aspnetcore/blob/main/src/Identity/Core/src/SignInManager.cs#L765
Any reason why this is private? Could it be made protected?
Use case is I want to override methods that calls it, however as it's private, I have no access
The text was updated successfully, but these errors were encountered: