Skip to content

Commit c278d3f

Browse files
committed
SupressResponseHeaderWWWAuthenticateForAjaxRequests updated README.md
1 parent 9c18cd8 commit c278d3f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,21 @@ public void ConfigureServices(IServiceCollection services)
129129
});
130130
}
131131
```
132+
133+
you can suppress the response WWW-Authenticate header (avoiding the browser to show a popup) for ajax requests by using a switch
134+
135+
```c#
136+
public void ConfigureServices(IServiceCollection services)
137+
{
138+
services.AddScoped<AuthenticationEvents>();
139+
140+
services
141+
.AddAuthentication(BasicAuthenticationDefaults.AuthenticationScheme)
142+
.AddBasicAuthentication(
143+
options =>
144+
{
145+
options.Realm = "My Application";
146+
options.SupressResponseHeaderWWWAuthenticateForAjaxRequests = true;
147+
});
148+
}
149+
```

0 commit comments

Comments
 (0)