dotnet / dotnet/aspnetcore

Configure `CanGenerateTwoFactorTokenAsync` for default token providers

Open
#12,762 3 comments 0 reactions 0 assignees View on GitHub
affected-few area-identity enhancement severity-minor
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

I am trying to change `PhoneNumberTokenProvider` to not generate 2FA, but there seems to be no way to configure this currently in v2.1.

It would be good to be able to remove a token provider, so I could add a custom one back; or add option to override the 2FA generation flag for the default providers.

Alternatively I'm thinking to override the `AddDefaultTokenProviders`, which I'd rather not, because for my use, the rest of the default providers are fine.

Contributor guide

Open the contributing guide

Research direction

Start by tracing AddDefaultTokenProviders and the default PhoneNumberTokenProvider implementation, focusing on CanGenerateTwoFactorTokenAsync. Compare the requested ability to remove or override a default provider with the existing extension points; done means an application can change the phone provider's 2FA-generation behavior without replacing unrelated default providers.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
authentication
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.