Skip to content

Commit

Permalink
SupressResponseHeaderWWWAuthenticateForAjaxRequests updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vborioni-onit committed Apr 8, 2019
1 parent 9c18cd8 commit c278d3f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,21 @@ public void ConfigureServices(IServiceCollection services)
});
}
```

you can suppress the response WWW-Authenticate header (avoiding the browser to show a popup) for ajax requests by using a switch

```c#
public void ConfigureServices(IServiceCollection services)
{
services.AddScoped<AuthenticationEvents>();

services
.AddAuthentication(BasicAuthenticationDefaults.AuthenticationScheme)
.AddBasicAuthentication(
options =>
{
options.Realm = "My Application";
options.SupressResponseHeaderWWWAuthenticateForAjaxRequests = true;
});
}
```

0 comments on commit c278d3f

Please sign in to comment.