You have entered the account and password to log in.
The ICurrentTenant cannot obtain the tenant ID before the /connect/token interface.
2 Answer(s)
- 
    0- Before a user is authenticated and a token is issued (i.e., before the - /connect/tokenendpoint is called), the ABP Framework resolves the current tenant using tenant resolvers (such as domain, header, cookie, or query string). However, the- ICurrentTenant.Idwill only be set if the tenant can be resolved from the incoming request.
- During the login process (before the token is issued), if the request does not contain sufficient tenant information (for example, the - __tenantheader, a tenant-specific subdomain, or a query string parameter),- ICurrentTenant.Idwill be null. This is by design: the tenant context is established based on the request, not the user credentials.
- To ensure - ICurrentTenantis set before authentication, you must configure and use a tenant resolver that can extract the tenant from the request (such as domain/subdomain, header, or query string). For example, in a multi-tenant Angular app, the frontend should send the- __tenantheader or use a tenant-specific subdomain.
- If you need to access tenant information during the login process, make sure your frontend provides the tenant identifier in the request, and your backend is configured to resolve it. 
 Example configuration: Configure<AbpTenantResolveOptions>(options => { options.AddDomainTenantResolver("{0}.yourdomain.com"); options.AddHeaderTenantResolver(); options.AddCookieTenantResolver(); options.AddQueryStringTenantResolver(); });- If the tenant cannot be resolved from the request, ICurrentTenant.Idwill remain null until after the user is authenticated and the token is issued.
 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. 
- 
    0

 
                                