ASP.NET Core API with authorization prompts for sign in

843 views Asked by At

We are using Windows Authentication on one endpoint in our C#/ASPNet Core 3.1 API. It is configured like:

Startup.ConfigureServices():

services.AddAuthentication(NegotiateDefaults.AuthenticationScheme).AddNegotiate();

Startup.Configure():

app.UseAuthentication();
app.UseAuthorization();

and the endpoint on which we require authentication has the [Authorize] attribute on the Post method in the controller:

[Authorize]
[HttpPost]
[Route("somewhere"]
public IActionResult Post() { ... }

In Chrome, I am prompted for credentials and then allowed to use the endpoint on subsequent requests (even if I cancel the prompt).

How to prevent the prompt?

0

There are 0 answers