Skip to content

Commit d54dd34

Browse files
Merge pull request #232932 from cilwerner/patch-1
Edit code snippet
2 parents bc2ef5e + 5c56cda commit d54dd34

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

articles/active-directory/develop/scenario-protected-web-api-app-configuration.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,7 @@ services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
197197
.AddMicrosoftIdentityWebApi(Configuration);
198198
services.Configure<JwtBearerOptions>(JwtBearerDefaults.AuthenticationScheme, options =>
199199
{
200-
var existingOnTokenValidatedHandler = options.Events.OnTokenValidated;
201-
options.Events.OnTokenValidated = async context =>
202-
{
203-
await existingOnTokenValidatedHandler(context);
204-
// Your code to add extra configuration that will be executed after the current event implementation.
205-
options.TokenValidationParameters.ValidIssuers = new[] { /* list of valid issuers */ };
206-
options.TokenValidationParameters.ValidAudiences = new[] { /* list of valid audiences */};
207-
};
200+
options.TokenValidationParameters.ValidAudiences = new[] { /* list of valid audiences */};
208201
});
209202
```
210203

0 commit comments

Comments
 (0)