Replace default token provider with single-active variant#25525
Merged
Conversation
Introduce AbpDefaultTokenProvider (10-min lifespan) replacing DataProtectorTokenProvider under TokenOptions.DefaultProvider, so challenge tokens (RequiresTwoFactor, ShouldChangePassword) become single-active. Document the token provider lineup and fix two factual errors in the 2FA doc.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR changes ABP Identity’s ASP.NET Core integration to replace the default ASP.NET Core Identity "Default" token provider with an ABP single-active implementation, making password-flow “challenge” tokens single-active per (user, purpose) with a short default lifespan.
Changes:
- Register
AbpDefaultTokenProviderunderTokenOptions.DefaultProviderand introduceAbpDefaultTokenProviderOptions(10-minute default lifespan). - Add an ASP.NET Core test suite to validate the default-provider override and purpose isolation behavior.
- Add/update Identity documentation explaining token-provider replacements and 2FA token behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/identity/src/Volo.Abp.Identity.AspNetCore/Volo/Abp/Identity/AspNetCore/AbpIdentityAspNetCoreModule.cs | Overrides the "Default" token provider registration to use AbpDefaultTokenProvider. |
| modules/identity/src/Volo.Abp.Identity.AspNetCore/Volo/Abp/Identity/AspNetCore/AbpDefaultTokenProviderOptions.cs | Adds options type setting provider name and 10-minute token lifespan. |
| modules/identity/src/Volo.Abp.Identity.AspNetCore/Volo/Abp/Identity/AspNetCore/AbpDefaultTokenProvider.cs | Implements the default provider as a single-active token provider. |
| modules/identity/test/Volo.Abp.Identity.AspNetCore.Tests/Volo/Abp/Identity/AspNetCore/AbpDefaultTokenProvider_Tests.cs | Adds tests verifying override behavior, defaults, and per-purpose isolation. |
| docs/en/modules/identity/two-factor-authentication.md | Updates 2FA documentation details (notably authenticator provider behavior and storage format). |
| docs/en/modules/identity/token-providers.md | Adds new documentation page describing ABP token providers and configuration/invalidation guidance. |
| docs/en/modules/identity-pro.md | Links the new “Identity Token Providers” documentation page from the module doc index. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #25525 +/- ##
==========================================
- Coverage 49.45% 49.44% -0.02%
==========================================
Files 3671 3673 +2
Lines 123912 123921 +9
Branches 9474 9474
==========================================
- Hits 61278 61270 -8
- Misses 60811 60829 +18
+ Partials 1823 1822 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
EngincanV
approved these changes
Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces ASP.NET Core's
DataProtectorTokenProvider<IdentityUser>registered underTokenOptions.DefaultProviderwithAbpDefaultTokenProvider(extendsAbpSingleActiveTokenProvider, 10-minute lifespan). Challenge tokens from the password flows (RequiresTwoFactor,ShouldChangePasswordOnNextLogin,PeriodicallyChangePassword) become single-active per(user, purpose).