#### [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')

## SecureHttpFetcher Class

Securely fetches content from external URIs with SSRF protection\.
This class should be registered with AddHttpClient for proper HTTP client configuration\.

```csharp
public class SecureHttpFetcher : Abblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher
```

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

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

## SecureHttpFetcher\(ILogger\<SecureHttpFetcher\>, HttpClient, IOptions\<SecureHttpFetchOptions\>\) Constructor {#Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetcher.SecureHttpFetcher(Microsoft.Extensions.Logging.ILogger_Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetcher_,System.Net.Http.HttpClient,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetchOptions_)}

Securely fetches content from external URIs with SSRF protection\.
This class should be registered with AddHttpClient for proper HTTP client configuration\.

```csharp
public SecureHttpFetcher(Microsoft.Extensions.Logging.ILogger<Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetcher> logger, System.Net.Http.HttpClient httpClient, Microsoft.Extensions.Options.IOptions<Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetchOptions> options);
```
#### Parameters

###### `logger` [Microsoft\.Extensions\.Logging\.ILogger&lt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger-1 'Microsoft\.Extensions\.Logging\.ILogger\`1')[SecureHttpFetcher](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetcher 'Abblix\.Oidc\.Server\.Features\.SecureHttpFetch\.SecureHttpFetcher')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger-1 'Microsoft\.Extensions\.Logging\.ILogger\`1') {#Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetcher.SecureHttpFetcher(Microsoft.Extensions.Logging.ILogger_Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetcher_,System.Net.Http.HttpClient,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetchOptions_).logger}

The logger for recording fetch operations and errors\.

###### `httpClient` [System\.Net\.Http\.HttpClient](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpclient 'System\.Net\.Http\.HttpClient') {#Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetcher.SecureHttpFetcher(Microsoft.Extensions.Logging.ILogger_Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetcher_,System.Net.Http.HttpClient,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetchOptions_).httpClient}

The HTTP client for making secure requests\.

###### `options` [Microsoft\.Extensions\.Options\.IOptions&lt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.options.ioptions-1 'Microsoft\.Extensions\.Options\.IOptions\`1')[SecureHttpFetchOptions](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetchOptions 'Abblix\.Oidc\.Server\.Features\.SecureHttpFetch\.SecureHttpFetchOptions')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.options.ioptions-1 'Microsoft\.Extensions\.Options\.IOptions\`1') {#Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetcher.SecureHttpFetcher(Microsoft.Extensions.Logging.ILogger_Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetcher_,System.Net.Http.HttpClient,Microsoft.Extensions.Options.IOptions_Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetchOptions_).options}

Configuration options for secure HTTP fetching\.
### Methods

## SecureHttpFetcher\.FetchAsync\<T\>\(Uri\) Method {#Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetcher.FetchAsync_T_(System.Uri)}

Fetches content from a URI with SSRF protection and response validation\.
Automatically handles JSON deserialization or raw string content based on the response Content\-Type\.

```csharp
public System.Threading.Tasks.Task<Abblix.Utils.Result<T,Abblix.Oidc.Server.Common.OidcError>> FetchAsync<T>(System.Uri uri);
```
#### Type parameters

###### `T` {#Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetcher.FetchAsync_T_(System.Uri).T}

The type to deserialize the response to\.
#### Parameters

###### `uri` [System\.Uri](https://learn.microsoft.com/en-us/dotnet/api/system.uri 'System\.Uri') {#Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetcher.FetchAsync_T_(System.Uri).uri}

The URI to fetch content from\.

Implements [FetchAsync&lt;T&gt;\(Uri\)](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher#Abblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher.FetchAsync_T_(System.Uri) 'Abblix\.Oidc\.Server\.Features\.SecureHttpFetch\.ISecureHttpFetcher\.FetchAsync\<T\>\(System\.Uri\)')

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[Abblix\.Utils\.Result&lt;](https://learn.microsoft.com/en-us/dotnet/api/abblix.utils.result-2 'Abblix\.Utils\.Result\`2')[T](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetcher#Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetcher.FetchAsync_T_(System.Uri).T 'Abblix\.Oidc\.Server\.Features\.SecureHttpFetch\.SecureHttpFetcher\.FetchAsync\<T\>\(System\.Uri\)\.T')[,](https://learn.microsoft.com/en-us/dotnet/api/abblix.utils.result-2 'Abblix\.Utils\.Result\`2')[OidcError](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.OidcError 'Abblix\.Oidc\.Server\.Common\.OidcError')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/abblix.utils.result-2 'Abblix\.Utils\.Result\`2')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
A Result containing either the deserialized content or an OidcError\.
