do you need me to reproduce this and send you my log for further document ?
Because when I try to implement this middleware now it can bypass and the switch tenant now show as expected. But I don't know if it will cause other error
public sealed class StripCookiesForBearerAccountApiMiddleware : IMiddleware
{
private const string AccountPublicApiPrefix = "/api/account";
public async Task InvokeAsync(HttpContext context, RequestDelegate next)
{
var path = context.Request.Path;
if (!path.StartsWithSegments(AccountPublicApiPrefix, StringComparison.OrdinalIgnoreCase))
{
await next(context);
return;
}
var authHeader = context.Request.Headers.Authorization.ToString();
if (string.IsNullOrEmpty(authHeader) ||
!authHeader.StartsWith("Bearer ", StringComparison.OrdinalIgnoreCase))
{
await next(context);
return;
}
context.Request.Headers.Remove("Cookie");
await next(context);
}
}
checking 2-3 XHR the token Bear value is almost the same, it's from fti after switching tenant.
The weird thing I've checked is that in localhost, I can still see Host as listed in the modal of switching tenant
I've got this issue when deploying to AKS, so is that maybe caused by a behind proxy ?
For more info, I use ABP version 10.3.0 And I got through the Switch Tenant modal in Angular admin I also try hard refresh test but still the same
I've used shared database
After choosing tenant fti then get the token to decode and I get
"tenantid": "3a1af4d8-364d-86dc-87c9-66b8c5f291f5" match this api
{
"items": [
{
"tenantId": "3a1aff20-3e15-936d-eed4-9ae0c7235e8e",
"tenantName": "tff",
"email": "thanhvl1@aaa.com"
},
{
"tenantId": "3a1af4d8-364d-86dc-87c9-66b8c5f291f5",
"tenantName": "fti",
"email": "thanhvl1@aaa.com"
}
]
}
In this admin app is a standard Angular host: it uses @volo/abp.ng.account and provideAccountPublicConfig() in app.config.ts, plus Lepton X (@volosoft/abp.ng.theme.lepton-x). We do not ship a custom “Switch tenant” dialog implementation in our admin src/ tree.
I also have checked db and api
But there this is weird because when I logged in it's come to next screen choose tenants, in this UI, I see the Host
thanks for your quick support, I'm missing setting this options.Applications["MVC"].RootUrl = configuration["AuthServer:Authority"]; in Identity
thanks for your guide, I implemented follow this guide and it worked
This worked perfectly. Thanks for your support