Exception message and full stack trace:
Steps to reproduce the issue: Need to call another app service endpoint.
From patient appservice call method in datamaintenance appservice.
so in my Patient Application module including service endpoint
protected IMedicalAidAppService MedicalAidHttpClient => LazyServiceProvider.LazyGetRequiredService<IMedicalAidAppService>();
this is defined in my datamaintenance module which the httpclient module exposes as :
public class DataMaintenanceHttpApiClientModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddHttpClientProxies(
typeof(DataMaintenanceApplicationContractsModule).Assembly,
DataMaintenanceRemoteServiceConsts.RemoteServiceName
);
In my patient app service
[DependsOn(
typeof(PatientDomainModule),
typeof(PatientApplicationContractsModule),
typeof(AbpDddApplicationModule),
typeof(AbpAutoMapperModule),
typeof(DataMaintenanceHttpApiClientModule),
typeof(AbpHttpClientIdentityModelModule)
)]
and calling :
public async Task<List<DefaultCodedNameValue<string>>> GetMedicalAidsAsync()
{
return await MedicalAidHttpClient.GetMedicalAidsAsync().ConfigureAwait(false);
}
this works if no [Authorize] header in data maintenance appservice otherwise getting unauthorized.
Appsettings: in patient.http:
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"RemoteServices": {
"DataMaintenance": {
"BaseUrl": "https://localhost:55344",
"UseCurrentAccessToken": "true"
}
}
}
if I authenticate to patient it works and in datamaintenance it works, but from patient to datamaintenance unauthorized.
So the auth token has the correct bearer in patient but not being passed through.
Pls can you assist
Check the docs before asking a question: https://abp.io/docs/latest
Check the samples to see the basic tasks: https://abp.io/docs/latest/samples
The exact solution to your question may have been answered before, and please first use the search on the homepage.
Provide us with the following info:
🧐 Hint: If you are using the ABP Studio, you can see all the information about your solution from the configuration window, which opens when you right-click on the solution and click on the Solution Configuration
button.
Template: app