hi andmattia
when I enter a tenant and request data from a new microservice, I only see data for my tenant, as expected. However, when I request user data, I see Host-level data.
This should be due to the tenant not identifying correctly.
You can add a middleware to your user data website. That prints the current claims and claim types.
app.UseAuthentication();
app.Use(async (httpContext, next) =>
{
var logger = httpContext.RequestServices.GetRequiredService<ILogger<YourModule>>();
var claims = httpContext.User.Claims.Select(x => new { x.Type, x.Value }).ToList();
logger.LogError("HttpContext.User Claims:");
logger.LogError(JsonSerializer.Serialize(claims));
var currentUser = httpContext.RequestServices.GetRequiredService<ICurrentUser>().GetAllClaims().Select(x => new { x.Type, x.Value }).ToList();
logger.LogError("Current User Claims:");
logger.LogError(JsonSerializer.Serialize(currentUser));
var userid = AbpClaimTypes.UserId;
var username = AbpClaimTypes.UserName;
var roleClaimType = AbpClaimTypes.Role;
logger.LogError($"UserId Claim Type: {userid}");
logger.LogError($"UserName Claim Type: {username}");
logger.LogError($"Role Claim Type: {roleClaimType}");
var authorizationHeader = httpContext.Request.Headers["Authorization"];
logger.LogError(!string.IsNullOrEmpty(authorizationHeader)
? $"Authorization Header: {authorizationHeader}"
: "Authorization Header is missing or empty.");
await next(httpContext);
});
Thanks
hi maria_ruiz
Can you share a project to reproduce the above problem?
liming.ma@volosoft.com
Thanks
hi
Can you share the full error logs of the AuthServer project?
liming.ma@volosoft.com Thanks
You can consider storing tokens in Redis.
The cache key can be userid + BrowserInfo
Similar with https://abp.io/community/articles/switching-between-organization-units-i5tokpzt#gsc.tab=0
Thanks.
hi
Can you share the logs from the current website and the gateway?
Thanks.
hi
But this is resulting in cookie size to be huge and is blocked by the app gateway.
Can you share the error message?
How can I reproduce the error?
Thanks.
hi
Can you try to add UsePathBase("/api") to your API website?
app.UsePathBase("/api");
app.UseRouting();
hi
Your code seems no problem.
We have created non-ABP external Blazor server UI project. But we can not specify request or client culture while sending.
You can set the Accept-Language in your Blazor server UI project
What is the current localization behavior?
Can you share some screenshots or logs?
Thanks.