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

## SsrfHttpClientServiceCollectionExtensions Class

Registers HTTP clients that initiate requests to client\-supplied URLs \(CIBA notification
endpoints, back\-channel logout URIs, JWKS/issuer fetches\)\. Every such client must route through
[SsrfValidatingHttpMessageHandler](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.SecureHttpFetch.SsrfValidatingHttpMessageHandler 'Abblix\.Oidc\.Server\.Features\.SecureHttpFetch\.SsrfValidatingHttpMessageHandler'); bundling the handler with the client registration
makes it impossible to add a new outbound client that silently skips SSRF protection\.

```csharp
public static class SsrfHttpClientServiceCollectionExtensions
```

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

## SsrfHttpClientServiceCollectionExtensions\.AddSsrfHttpClient\(this IServiceCollection, string, Action\<IServiceProvider,HttpClient\>\) Method {#Abblix.Oidc.Server.Features.SecureHttpFetch.SsrfHttpClientServiceCollectionExtensions.AddSsrfHttpClient(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection,string,System.Action_System.IServiceProvider,System.Net.Http.HttpClient_)}

Registers a named HTTP client whose primary handler is the SSRF\-validating handler\.

```csharp
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddSsrfHttpClient(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name, System.Action<System.IServiceProvider,System.Net.Http.HttpClient> configureClient);
```
#### Parameters

###### `services` [Microsoft\.Extensions\.DependencyInjection\.IServiceCollection](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection 'Microsoft\.Extensions\.DependencyInjection\.IServiceCollection') {#Abblix.Oidc.Server.Features.SecureHttpFetch.SsrfHttpClientServiceCollectionExtensions.AddSsrfHttpClient(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection,string,System.Action_System.IServiceProvider,System.Net.Http.HttpClient_).services}

###### `name` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.SecureHttpFetch.SsrfHttpClientServiceCollectionExtensions.AddSsrfHttpClient(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection,string,System.Action_System.IServiceProvider,System.Net.Http.HttpClient_).name}

###### `configureClient` [System\.Action&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.action-2 'System\.Action\`2')[System\.IServiceProvider](https://learn.microsoft.com/en-us/dotnet/api/system.iserviceprovider 'System\.IServiceProvider')[,](https://learn.microsoft.com/en-us/dotnet/api/system.action-2 'System\.Action\`2')[System\.Net\.Http\.HttpClient](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpclient 'System\.Net\.Http\.HttpClient')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.action-2 'System\.Action\`2') {#Abblix.Oidc.Server.Features.SecureHttpFetch.SsrfHttpClientServiceCollectionExtensions.AddSsrfHttpClient(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection,string,System.Action_System.IServiceProvider,System.Net.Http.HttpClient_).configureClient}

#### Returns
[Microsoft\.Extensions\.DependencyInjection\.IHttpClientBuilder](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.ihttpclientbuilder 'Microsoft\.Extensions\.DependencyInjection\.IHttpClientBuilder')

## SsrfHttpClientServiceCollectionExtensions\.AddSsrfHttpClient\<TClient,TImplementation\>\(this IServiceCollection, Action\<IServiceProvider,HttpClient\>\) Method {#Abblix.Oidc.Server.Features.SecureHttpFetch.SsrfHttpClientServiceCollectionExtensions.AddSsrfHttpClient_TClient,TImplementation_(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection,System.Action_System.IServiceProvider,System.Net.Http.HttpClient_)}

Registers a typed HTTP client whose primary handler is the SSRF\-validating handler\.

```csharp
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddSsrfHttpClient<TClient,TImplementation>(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action<System.IServiceProvider,System.Net.Http.HttpClient> configureClient)
    where TClient : class
    where TImplementation : class, TClient;
```
#### Type parameters

###### `TClient` {#Abblix.Oidc.Server.Features.SecureHttpFetch.SsrfHttpClientServiceCollectionExtensions.AddSsrfHttpClient_TClient,TImplementation_(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection,System.Action_System.IServiceProvider,System.Net.Http.HttpClient_).TClient}

###### `TImplementation` {#Abblix.Oidc.Server.Features.SecureHttpFetch.SsrfHttpClientServiceCollectionExtensions.AddSsrfHttpClient_TClient,TImplementation_(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection,System.Action_System.IServiceProvider,System.Net.Http.HttpClient_).TImplementation}
#### Parameters

###### `services` [Microsoft\.Extensions\.DependencyInjection\.IServiceCollection](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection 'Microsoft\.Extensions\.DependencyInjection\.IServiceCollection') {#Abblix.Oidc.Server.Features.SecureHttpFetch.SsrfHttpClientServiceCollectionExtensions.AddSsrfHttpClient_TClient,TImplementation_(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection,System.Action_System.IServiceProvider,System.Net.Http.HttpClient_).services}

###### `configureClient` [System\.Action&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.action-2 'System\.Action\`2')[System\.IServiceProvider](https://learn.microsoft.com/en-us/dotnet/api/system.iserviceprovider 'System\.IServiceProvider')[,](https://learn.microsoft.com/en-us/dotnet/api/system.action-2 'System\.Action\`2')[System\.Net\.Http\.HttpClient](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpclient 'System\.Net\.Http\.HttpClient')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.action-2 'System\.Action\`2') {#Abblix.Oidc.Server.Features.SecureHttpFetch.SsrfHttpClientServiceCollectionExtensions.AddSsrfHttpClient_TClient,TImplementation_(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection,System.Action_System.IServiceProvider,System.Net.Http.HttpClient_).configureClient}

#### Returns
[Microsoft\.Extensions\.DependencyInjection\.IHttpClientBuilder](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.ihttpclientbuilder 'Microsoft\.Extensions\.DependencyInjection\.IHttpClientBuilder')
