Skip to content

Using RequireAuthorization results in an ambiguous method compilation error #6897

@davidfowl

Description

@davidfowl

Describe the bug

Trying to require authorization on an endpoint route without passing authorize data or a policy name results in a compilation error.

To Reproduce

app.UseRouting(routes =>
{
	routes.MapApplication();

	routes.MapGet("/", context =>
	{
		return Task.CompletedTask;
	})
	.RequireAuthorization();
});

Expected behavior

It shouldn't result in a compilation error.

Screenshots

image

cc @JamesNK @rynowak

Metadata

Metadata

Assignees

Labels

area-middlewareIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewares

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions