Azure-Samples / Azure-Samples/active-directory-dotnet-native-aspnetcore-v2
protected web api with GetAadIssuerValidator
- 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
Assessment
This issue has not been assessed yet.