asp.net-core-3.1

ASP.Net Core makes too many cookies for my app to handle

时光总嘲笑我的痴心妄想 提交于 2021-02-17 05:50:06
问题 I have a test application that I am using to test integration with my WSO2 Identity Server IDP. When run by itself it works just fine. It makes an .AspNetCore.Antiforgery cookie and an .AspNetCore.Cookies cookie. The anti-forgery cookie is 190 bytes and the main cookie is 3.7K bytes. But if I login to another application first, then load my my test harness page, it get 4 additional cookies: .AspNetCore.CookiesC1 - 4K Bytes .AspNetCore.CookiesC2 - 4K Bytes .AspNetCore.CookiesC3 - 4K Bytes

ASP.Net Core makes too many cookies for my app to handle

倖福魔咒の 提交于 2021-02-17 05:50:01
问题 I have a test application that I am using to test integration with my WSO2 Identity Server IDP. When run by itself it works just fine. It makes an .AspNetCore.Antiforgery cookie and an .AspNetCore.Cookies cookie. The anti-forgery cookie is 190 bytes and the main cookie is 3.7K bytes. But if I login to another application first, then load my my test harness page, it get 4 additional cookies: .AspNetCore.CookiesC1 - 4K Bytes .AspNetCore.CookiesC2 - 4K Bytes .AspNetCore.CookiesC3 - 4K Bytes

Can't access httpcontext extension methods in .net standard

好久不见. 提交于 2021-02-17 02:02:10
问题 I have this .NET Standard library where I want to write a .NET Core middleware. Inside which I want to do : Endpoint endpoint = httpContext.GetEndpoint(); The GetEndpoint() extension method can't be resolved. I have referenced Microsoft.AspNetCore.Http and I have both Microsoft.AspNetCore.Http.Abstractions and Microsoft.AspNetCore.Mvc.Core packages added to the project. Is there a solution to this, am I missing something? 回答1: I assume you're writing a middleware for ASP.NET Core 3.1 since

Can't access httpcontext extension methods in .net standard

你离开我真会死。 提交于 2021-02-17 02:01:49
问题 I have this .NET Standard library where I want to write a .NET Core middleware. Inside which I want to do : Endpoint endpoint = httpContext.GetEndpoint(); The GetEndpoint() extension method can't be resolved. I have referenced Microsoft.AspNetCore.Http and I have both Microsoft.AspNetCore.Http.Abstractions and Microsoft.AspNetCore.Mvc.Core packages added to the project. Is there a solution to this, am I missing something? 回答1: I assume you're writing a middleware for ASP.NET Core 3.1 since

SignInManager<TUser>.PasswordSignInAsync() is throwing System.Text.Json object cycle exception

人盡茶涼 提交于 2021-02-11 18:16:00
问题 Few days ago I decided to rewrite old API project from .net core 2.0 to 3.1 but today I faced with an error which I cannot solve. After rewriting "AccountManager" class _signInManager.PasswordSignInAsync() starts to throw error connected with Json object cycle. Exception: ((System.Text.Json.JsonException)ex).Message: A possible object cycle was detected which is not supported. This can either be due to a cycle or if the object depth is larger than the maximum allowed depth of 32. Example of

.NET Core Web API Application cannot connect to SQL server running on Docker

别来无恙 提交于 2021-02-11 14:49:16
问题 Using MAC. Error (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server). Connection string "Data Source=localhost,1433;Initial Catalog=MyDatabase;Integrated Security=True;User id=sa;Password=MyPassword;MultipleActiveResultSets=true" Using .NET Core 3.1. The Web API is running in a container The database is running on docker container. ports mapped 1433:1433 Able to query the database from Azure Data Studio. But while trying to connect from .net.core application it

AuthorizeAttribute not working with Endpoint Routing in ASP.NET Core 3.1

社会主义新天地 提交于 2021-02-11 09:59:08
问题 I migrated my ASP.NET Core application from version 2.2 to 3.1. I have a controller with [Authorize] attribute like this: [ApiController] [Authorize(policy: "MyPolicy")] [Route("api/v{version:apiVersion}/[controller]")] public class MyController : Controller And the policy is defined in Startup.cs like this: services.AddAuthorization(options => { options.AddPolicy("MyPolicy", policy => { policy.RequireRole("MyRole"); policy.RequireScope("my-scope"); } ); }); Everything worked fine in 2.2, but

Using Azure B2C with MVC, .NET Core 3.1

馋奶兔 提交于 2021-02-11 09:10:19
问题 Could anyone provide some insight or new links on using Azure B2C with MVC, .NET Core 3.1. Most examples are based on Core 2.2 https://docs.microsoft.com/en-us/samples/azure-samples/active-directory-b2c-dotnetcore-webapp/an-aspnet-core-web-app-with-azure-ad-b2c/ However, it seems more than a few things are done differently with 3.1. The error I encounter in 2.2 is: System.ArgumentNullException: Value cannot be null. (Parameter 'uriString') at System.Uri..ctor(String uriString) at Microsoft

Using Azure B2C with MVC, .NET Core 3.1

岁酱吖の 提交于 2021-02-11 09:07:42
问题 Could anyone provide some insight or new links on using Azure B2C with MVC, .NET Core 3.1. Most examples are based on Core 2.2 https://docs.microsoft.com/en-us/samples/azure-samples/active-directory-b2c-dotnetcore-webapp/an-aspnet-core-web-app-with-azure-ad-b2c/ However, it seems more than a few things are done differently with 3.1. The error I encounter in 2.2 is: System.ArgumentNullException: Value cannot be null. (Parameter 'uriString') at System.Uri..ctor(String uriString) at Microsoft

Using Azure B2C with MVC, .NET Core 3.1

試著忘記壹切 提交于 2021-02-11 09:06:28
问题 Could anyone provide some insight or new links on using Azure B2C with MVC, .NET Core 3.1. Most examples are based on Core 2.2 https://docs.microsoft.com/en-us/samples/azure-samples/active-directory-b2c-dotnetcore-webapp/an-aspnet-core-web-app-with-azure-ad-b2c/ However, it seems more than a few things are done differently with 3.1. The error I encounter in 2.2 is: System.ArgumentNullException: Value cannot be null. (Parameter 'uriString') at System.Uri..ctor(String uriString) at Microsoft