Thanks for the issue
Hi When GetLocalizationConfigAsync method of AbpApplicationConfigurationAppService class is called, we get tons of same localization pairs based on how many modules are loaded. This is dramatically time consuming in both api calls and page loads. problem is shown in following screen shots:
And blah blah blah...
All these repeated and same pairs come in one response, and perhaps takes at least 20 seconds in real published scenarios. Have you considered any fix for this?
Thanks.
Hi, Thanks. That solved the problem.
Hi,
I can reproduce the problem, can you create a new project to reproduce and send it to me by email? shiwei.liang@volosoft.com Thanks.
Hi. I sent the requested sample to your email address. Thanks.
Hi I tried to override some methods in AbpApplicationConfigurationAppService class as follow:
public class CustomApplicationConfigurationAppService :
AbpApplicationConfigurationAppService
{
public CustomApplicationConfigurationAppService(
IOptions<AbpLocalizationOptions> localizationOptions,
IOptions<AbpMultiTenancyOptions> multiTenancyOptions,
IServiceProvider serviceProvider,
IAbpAuthorizationPolicyProvider abpAuthorizationPolicyProvider,
IPermissionDefinitionManager permissionDefinitionManager,
DefaultAuthorizationPolicyProvider defaultAuthorizationPolicyProvider,
IPermissionChecker permissionChecker,
IAuthorizationService authorizationService,
ICurrentUser currentUser,
ISettingProvider settingProvider,
ISettingDefinitionManager settingDefinitionManager,
IFeatureDefinitionManager featureDefinitionManager,
ILanguageProvider languageProvider,
ITimezoneProvider timezoneProvider,
IOptions<AbpClockOptions> abpClockOptions,
ICachedObjectExtensionsDtoService cachedObjectExtensionsDtoService)
: base(localizationOptions, multiTenancyOptions, serviceProvider, abpAuthorizationPolicyProvider,
permissionDefinitionManager, defaultAuthorizationPolicyProvider, permissionChecker,
authorizationService,
currentUser, settingProvider, settingDefinitionManager, featureDefinitionManager, languageProvider,
timezoneProvider, abpClockOptions, cachedObjectExtensionsDtoService)
{
}
protected override async Task<ApplicationLocalizationConfigurationDto> GetLocalizationConfigAsync()
{
var localizationConfig = new ApplicationLocalizationConfigurationDto();
return localizationConfig;
}
}
Add replaced using traditional style in my ApplicationModule.cs : context.Services.Replace(ServiceDescriptor.Transient<IAbpApplicationConfigurationAppService, CustomApplicationConfigurationAppService>());
when I GET /api/abp/application-configuration from swagger, the result is as expected and localization is empty: but when launching web project, the response from GET request to /Abp/ApplicationConfigurationScript contains all localization data:
Why is this happening? And what is the solution?
Thanks a lot This solved the problem Better to update sample to avoid future duplicate questions
I want to implement resolver for web api project:
Configure<AbpTenantResolveOptions>(options =>
{
options.AddDomainTenantResolver("{0}.api.getabp.net:44302");
});
Then, I want to go to https://tenant1.api.getabp.net:44302/swagger/index.html When authorizing, I want to be automatically be directed to https://tenant.ids.getabp.net:44301 After that, redirect back to https://tenant1.api.getabp.net:44302/swagger/index.html Now, my swagger client is authorized and the active tenant is tenant1 Hence, current tenant id will tenant1 id. Just like web project.
Hope you understand
Actually this worked for me
"https://*.api.getabp.net,https://*.web.getabp.net,https://api.getabp.net:44302"
This is solution for host user authorization.
Now, the second part. How should we handle https://tenant1.api.getabp.net:44302/swagger/index.html for tenant1?
Hi there
First simple scenario:
"IdentityServer": {
"Clients": {
"BookStore_Web": {
"ClientId": "BookStore_Web",
"ClientSecret": "1q2w3e*",
"RootUrl": "https://{0}.web.getabp.net:44303"
},
"BookStore_Swagger": {
"ClientId": "BookStore_Swagger",
"ClientSecret": "1q2w3e*",
"RootUrl": "https://{0}.api.getabp.net:44302"
}
}
//Web Client
var webClientId = configurationSection["BookStore_Web:ClientId"];
if (!webClientId.IsNullOrWhiteSpace())
{
var webClientRootUrl = configurationSection["BookStore_Web:RootUrl"].EnsureEndsWith('/');
/* BookStore_Web client is only needed if you created a tiered
* solution. Otherwise, you can delete this client. */
await CreateClientAsync(
name: webClientId,
scopes: commonScopes,
grantTypes: new[] { "hybrid" },
secret: (configurationSection["BookStore_Web:ClientSecret"] ?? "1q2w3e*").Sha256(),
redirectUri: $"{webClientRootUrl}signin-oidc",
postLogoutRedirectUri: $"{webClientRootUrl}signout-callback-oidc",
frontChannelLogoutUri: $"{webClientRootUrl}Account/FrontChannelLogout",
corsOrigins: new[] { webClientRootUrl.RemovePostFix("/") }
);
}
// Swagger Client
var swaggerClientId = configurationSection["BookStore_Swagger:ClientId"];
if (!swaggerClientId.IsNullOrWhiteSpace())
{
var swaggerRootUrl = configurationSection["BookStore_Swagger:RootUrl"].TrimEnd('/');
await CreateClientAsync(
name: swaggerClientId,
scopes: commonScopes,
grantTypes: new[] { "authorization_code" },
secret: (configurationSection["Recruitans_Swagger:ClientSecret"] ?? "1q2w3e*").Sha256(),
requireClientSecret: false,
redirectUri: $"{swaggerRootUrl}/swagger/oauth2-redirect.html",
corsOrigins: new[] { swaggerRootUrl.RemovePostFix("/") }
);
}
This is the initial scenario that I cant use swagger api.
Hi Trying to implement DomanTenantResolver sample in my own project, everything is fine, except I cant use swagger in *HttpiApi.Host. Redirection from Identity back to api does not work. Neither with tenant available nor without tenant(host). I also tried to add OnChallenge event to JwtBearerOptions during configuration, but no success. I have no idea how to implement this. P.S: In your sample resolver, I cant event authorize with "web.getap.com:1234/swagger". In other words, api is out of reach.
Any help would be appreciated