-
ABP Framework version: v8.3.4
-
UI Type: Angular
-
Database System: EF Core (PostgreSQL)
-
Tiered (for MVC) or Auth Server Separated (for Angular): yes
-
Exception message and full stack trace:
-
Steps to reproduce the issue:
Some of my tenants have a worker service implemented on-premises. I am authenticating them via the Client Credentials flow in my AuthServer. Now, I need to implement an authorization filter using an API key that is configured as a SettingDefinition for each tenant that needs to use these worker services.
My question is: How can I retrieve the provider key (tenant ID) based on the value of the API key setting? Then, I need to adjust the request scope to the tenant obtained from that provider key.
1 Answer(s)
-
0
Hi,
It seems there is no built-in way to retrieve it. But you can override SettingProvider in your application and add another method that applies your custom query by using re
https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingProvider.csbut still you won't be able to access to data source directly to apply a custom query with value, you can also override on of the existing Setting Value Providers
https://abp.io/docs/9.0/framework/infrastructure/settings#setting-value-providerswhich is
TenantSettingValueProvider
in this case: https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/TenantSettingValueProvider.csOr you can create your own value provider according to your custom requirements and configure it:
Configure<AbpSettingOptions>(options => { options.ValueProviders.Add<CustomSettingValueProvider>(); });