-
Notifications
You must be signed in to change notification settings - Fork 25k
Closed
Labels
Pri1Source - Docs.msDocs Customer feedback via GitHub IssueDocs Customer feedback via GitHub Issuedoc-bug
Description
I've tried to migrate a net core 2.2 web application to net core 3.0 preview 9. I'm having troubles with middleware, where HttpContext.User.Identity.IsAuthenticated always returns false even if the user is authenticated. To ensure that I do not made any mistakes during migration of our application, I even tried to set up a new 3.0 web application project and follow the instructions on this page. In the code below IsAuthenticated is always false.
How do I make this work in 3.0? I have to check authenticated user to resolve the culture based on a SQL query.
options.RequestCultureProviders.Insert(0, new CustomRequestCultureProvider(async context =>
{
var isAuthenticated = context.User.Identity.IsAuthenticated; // always false in 3.0 preview9
// My custom request culture logic
return new ProviderCultureResult("en");
}));Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: d1833676-ff1b-c587-cc9c-81afffa8ef68
- Version Independent ID: ad989395-3f49-4d55-521e-cf6fe56281ee
- Content: Globalization and localization in ASP.NET Core
- Content Source: aspnetcore/fundamentals/localization.md
- Product: aspnet-core
- Technology: aspnetcore-fundamentals
- GitHub Login: @Rick-Anderson
- Microsoft Alias: riande
Metadata
Metadata
Assignees
Labels
Pri1Source - Docs.msDocs Customer feedback via GitHub IssueDocs Customer feedback via GitHub Issuedoc-bug