#### [Abblix\.Oidc\.Server](https://www.abblix.com/en/docs/api/abblix-oidc-server 'index')
### [Abblix\.Oidc\.Server\.Features\.SecureHttpFetch](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.SecureHttpFetch 'Abblix\.Oidc\.Server\.Features\.SecureHttpFetch')

## SecureHttpFetcherExtensions Class

Provides reusable functionality for fetching JSON Web Key Sets \(JWKS\) from remote URIs
with SSRF protection and consistent error handling\.

```csharp
public static class SecureHttpFetcherExtensions
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → SecureHttpFetcherExtensions
### Methods

## SecureHttpFetcherExtensions\.FetchKeysAsync\(this ISecureHttpFetcher, Uri, ILogger, string, string\) Method {#Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetcherExtensions.FetchKeysAsync(thisAbblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher,System.Uri,Microsoft.Extensions.Logging.ILogger,string,string)}

Fetches JSON Web Keys from a JWKS URI with SSRF protection and optional filtering\.

```csharp
public static System.Collections.Generic.IAsyncEnumerable<Abblix.Jwt.JsonWebKey> FetchKeysAsync(this Abblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher secureFetcher, System.Uri jwksUri, Microsoft.Extensions.Logging.ILogger logger, string entityId, string entityType);
```
#### Parameters

###### `secureFetcher` [ISecureHttpFetcher](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher 'Abblix\.Oidc\.Server\.Features\.SecureHttpFetch\.ISecureHttpFetcher') {#Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetcherExtensions.FetchKeysAsync(thisAbblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher,System.Uri,Microsoft.Extensions.Logging.ILogger,string,string).secureFetcher}

HTTP fetcher with SSRF protection and caching\.

###### `jwksUri` [System\.Uri](https://learn.microsoft.com/en-us/dotnet/api/system.uri 'System\.Uri') {#Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetcherExtensions.FetchKeysAsync(thisAbblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher,System.Uri,Microsoft.Extensions.Logging.ILogger,string,string).jwksUri}

The URI to fetch the JWKS from\.

###### `logger` [Microsoft\.Extensions\.Logging\.ILogger](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger 'Microsoft\.Extensions\.Logging\.ILogger') {#Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetcherExtensions.FetchKeysAsync(thisAbblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher,System.Uri,Microsoft.Extensions.Logging.ILogger,string,string).logger}

Logger for recording fetch operations and errors\.

###### `entityId` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetcherExtensions.FetchKeysAsync(thisAbblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher,System.Uri,Microsoft.Extensions.Logging.ILogger,string,string).entityId}

The identifier of the entity \(client ID or issuer\) for logging\.

###### `entityType` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetcherExtensions.FetchKeysAsync(thisAbblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher,System.Uri,Microsoft.Extensions.Logging.ILogger,string,string).entityType}

The type of entity \(e\.g\., "client" or "issuer"\) for logging\.

#### Returns
[System\.Collections\.Generic\.IAsyncEnumerable&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.iasyncenumerable-1 'System\.Collections\.Generic\.IAsyncEnumerable\`1')[JsonWebKey](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.JsonWebKey 'Abblix\.Jwt\.JsonWebKey')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.iasyncenumerable-1 'System\.Collections\.Generic\.IAsyncEnumerable\`1')  
An async enumerable of JSON Web Keys from the JWKS endpoint\.
Returns empty if fetching fails or the JWKS is invalid\.
