The error InvalidOperationException: sub claim is missing
after upgrading to ABP 9.0 (while still using IdentityServer4) is due to a missing sub
(subject) claim in the authentication response. IdentityServer4 requires the sub
claim to identify the user.
In ABP 9.0, there have been significant changes and migration steps, especially regarding authentication and claims handling. If you have not migrated to OpenIddict and are still using IdentityServer4, you must ensure that your authentication pipeline and claims transformation logic are compatible with the new ABP version.
Specifically, you should:
sub
claim is present and correctly mapped for the authenticated user.sub
claim.sub
claim in the identity token.For more details and migration steps, see:
These resources provide guidance on handling authentication and claims in ABP 9.0 and can help you resolve the missing sub
claim issue.
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
To properly integrate your Blazor Server module (GravityPlatform.AccountManagement) into your Blazor Web App (app-nolayers template), you need to ensure the following dependencies and references are set up:
Add Project References:
Module Dependencies:
[DependsOn(
typeof(GravityPlatformAccountManagementBlazorModule)
)]
public class GravityPlatformWebModule : AbpModule
{
// ...
}
Menu Contributor:
Bundling:
Migration and Permissions:
UI Registration:
Example summary:
If you follow these steps, your module's menu and pages should appear in your Blazor Web App.
Sources:
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
In a Blazor WebApp "No Layer" (monolithic) ABP solution, when adding a new module via ABP Suite, you are correct in your assumptions:
For a Blazor WebApp "No Layer" solution, choose "Blazor Server" when adding modules for the most seamless integration.
Regarding documentation and enhancements for Blazor WebApp, ABP is actively evolving its documentation and features. The most up-to-date and official starting point is the "Get Started" section:
This page is regularly updated as new features and documentation become available.
If you need to add modules or extend your application, follow the standard ABP modularity approach, but always prefer the "Blazor Server" option for modules in a monolithic Blazor WebApp.
Sources:
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
The "Could not find localization source" errors (AMS, AbpUi, AbpIdentity) indicate that the required localization resources are missing or not properly registered after your upgrade. This is a common issue when upgrading major ABP versions, especially from v4.x to v9.x, due to changes in the localization system and resource file structure.
ConfigureServices
method using the new ABP v9 syntax.The Uncaught TypeError: id.replace is not a function
error is likely caused by a JavaScript code expecting a string id
, but receiving an object or another type. This can happen if the structure of data returned from the backend has changed after the upgrade, or if a localization key is missing and returns an object instead of a string.
id
variable is always a string before calling .replace
.The UI issues (e.g., "PagerShowMenuEntries" and "ProcessingWithThreeDot" showing as raw keys) are also related to missing or unregistered localization resources.
Recommended Steps:
Source:
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
If the problem persists, you can contact ABP support directly at info@abp.io with the details of the email address and registration attempt.
Sources:
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
This error, "Validating access_token failed, wrong state/nonce," typically occurs in ABP Angular applications when multiple tabs are open and the session expires or the access_token is deleted. The root cause is that the OAuth2/OIDC state and nonce values are stored in browser storage (localStorage/sessionStorage), and having multiple tabs can cause these values to become out of sync, especially after a session timeout or manual token removal. Chrome and Edge are more aggressive in synchronizing storage across tabs, which is why the issue is more visible there compared to Firefox.
Single Tab Recommendation:
This is a known limitation of SPA OAuth2/OIDC flows. Advise users to avoid logging in again in multiple tabs simultaneously after session expiration.
Custom State/Nonce Storage:
Consider customizing the storage mechanism for state/nonce to be tab-specific (e.g., using sessionStorage instead of localStorage, or using a unique key per tab).
Session Management Module:
ABP Commercial provides a Session Management feature to help prevent concurrent login/session issues. See the documentation for more details.
Logout Handling:
Ensure that your logout implementation clears all relevant tokens and state in all tabs, possibly by broadcasting a logout event using localStorage or another mechanism.
Reference Issues:
This is a common scenario in OAuth2/OIDC SPAs and is discussed in the community and GitHub issues. See the following for more details and possible workarounds:
Sources:
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
ABP Framework does not provide a built-in LastLogin field in the default Users table (AbpUsers). However, ABP does offer a way to track user login events through the Security Log feature, which records login and logout activities.
Use Security Logs to Track Logins
AbpSecurityLogs
(or similar, depending on your version).Custom LastLogin Property (Recommended for Direct Access)
Example:
// 1. Add property to user entity (see ABP docs for entity extension)
ObjectExtensionManager.Instance
.MapEfCoreProperty<IdentityUser, DateTime?>("LastLoginTime");
// 2. Update LastLoginTime after successful login
user.SetProperty("LastLoginTime", DateTime.UtcNow);
SignalR/Active User Tracking (Optional)
Sources:
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
This error typically occurs when your Angular build process tries to load a .js.map
file as a JavaScript module, which is not correct. This is usually caused by an incorrect import or a misconfiguration in your project.
Check for Incorrect Imports
.js.map
files anywhere in your codebase. You should only import JavaScript or TypeScript files, not source maps.Clean and Reinstall Node Modules
node_modules
folder and yarn.lock
file:
rm -rf node_modules yarn.lock
yarn install
Check Angular and ABP Versions
@angular/*
and @abp/*
package versions are compatible and consistent. For ABP v9.1.0, you should use Angular 17.x and matching ABP Angular packages.Check tsconfig and angular.json
tsconfig.json
and angular.json
do not include or reference .js.map
files in the files
, include
, or assets
sections.Check for Custom Webpack Configurations
.js.map
files as entry points or modules.Restart the Angular Development Server
yarn start
If you follow these steps, the error should be resolved. This issue is not specific to ABP, but rather to the Angular/Webpack build process.
Sources:
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
In ABP v9.2.0, the SaaS module validates the tenant connection string before saving it. If you are storing the connection string encrypted, the framework will attempt to validate the encrypted value, which will fail because it is not a valid SQL Server connection string in plain text.
The correct approach is to ensure that the connection string is decrypted before validation. Overriding CheckConnectionStringAsync
is the right idea, but you must also ensure that the decrypted connection string is passed to the base method and to the framework's validation logic.
In your CreateAsync
override, you are encrypting the connection string before assigning it to input.ConnectionStrings.Default
. However, the SaaS module expects the connection string in plain text for validation, and only after validation should it be encrypted for storage.
Solution:
input.ConnectionStrings.Default
before calling base.CreateAsync(input)
.Example:
public override async Task<SaasTenantDto> CreateAsync(SaasTenantCreateDto input)
{
var servers = await _availableSqlServerAppService.GetListAsync(new GetAvailableSqlServersInput {AvailableForTenantDatabase = true});
var first = servers.Items.OrderBy(i => i.NrOfTenants).First();
var defaultConnectionString = new SqlConnectionStringBuilder(DbConnectionOptions.ConnectionStrings.Default);
var baseDBName = string.Join('.', defaultConnectionString.InitialCatalog.Split(".").SkipLast(1));
var connectionString = new SqlConnectionStringBuilder
{
InitialCatalog = $"{baseDBName}.Tenant.{input.Name}",
DataSource = first.SqlServerName,
UserID = first.LoginUser,
Password = _stringEncryptionService.Decrypt(first.EncryptedPassword),
TrustServerCertificate = true
};
await CreateAzureDatabaseIfNotExists(connectionString);
// Assign the plain connection string for validation
input.ConnectionStrings.Default = connectionString.ConnectionString;
var result = await base.CreateAsync(input);
// Optionally, encrypt the connection string after creation for storage
// (Requires customizing the storage logic, not just the input)
return result;
}
References:
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
For ABP Commercial applications, the license key is required in production. You must provide the ABP license key either in your appsettings.secrets.json or as an environment variable for your deployed application to function. This is confirmed in the referenced support post:
The ABP Commercial license is time-based. If your license expires, deployed applications that require license validation (including those in production) will stop functioning. The license check is enforced at runtime, regardless of whether the key is stored in appsettings.secrets.json or provided via environment variables.
According to the official FAQ:
For critical deployments, ensure your license is always valid to avoid service interruptions.
Sources:
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.