aspnetcore
aspnetcore copied to clipboard
Should HttpSysDefaults.AuthenticationScheme be a const string?
Right now it is a readonly field and is disallowed to use in a const context. Also this is inconsistency with other authentication packages like JwtBearer.
Expected result
This should compile:
[Authorize(AuthenticationSchemes = HttpSysDefaults.AuthenticationScheme)]
public class FooController : Controller
{
// ...
}
Actual result
CS0182 compilation error: An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type.
This would be a breaking change in a minor release.