Azure-Samples / Azure-Samples/active-directory-dotnet-native-aspnetcore-v2

protected web api with GetAadIssuerValidator

Open
#189 1 comment 0 reactions 0 assignees View on GitHub
answered question
Dominant language
C#
Stars
290
Forks
194
PR merge metrics
No merged PRs in 30d

Description

```
- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [ x] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)
```

I am using .NET 5.0 and trying to validate the issuer. Do we have any samples doing this? I have not figure out how to get the service provider (IServiceProvider) in order to call GetRequiredService,

```
MicrosoftIdentityIssuerValidatorFactory microsoftIdentityIssuerValidatorFactory =
**_serviceProvider**.GetRequiredService();

options.TokenValidationParameters.IssuerValidator = microsoftIdentityIssuerValidatorFactory.GetAadIssuerValidator(options.Authority).Validate;
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.