나는 아래 코드를 우회하는 인증을 추가하는 동안 지역 개발을,나를 사용하여 AD Azure&.NET 핵심입니다.
#if !DEBUG
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApi(Configuration.GetSection("AzureAd"));
#endif
그러나 그 이후 나는 컨트롤러에 의해 보호 권한을 부여 특성,어떻게 우회하는 권한을 부여 특성을 내부의 컨트롤러는 동안 지역 개발:
[Authorize(Roles = "Buyer")]
public class ProductController : ApiBaseController
{
}
습니다.NET Framework 나는 아래 코드를 재정의 권한을 부여 특성:
public class MyAuthorizeAttribute : AuthorizeAttribute
{
#if DEBUG
protected override bool AuthorizeCore(HttpContextBase httpContext)
{
return true;
}
#endif
}
무엇이 다음과 같은 코드를 사용합니다.NET Core? 또는 어떤 다른 방법으로 우리는 무시할 수 있습 권한을 부여 특성에서 시작합니다.cs 등?