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

## ServiceCollectionExtensions Class

Extension methods that register the Abblix OpenID Connect server for ASP\.NET Core Minimal APIs\.

```csharp
public static class ServiceCollectionExtensions
```

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

### Remarks
This is the Minimal API counterpart of the MVC integration's `AddOidcServices`/`AddOidcMvc` pair\.
The two adapters share the framework\-neutral core \(`AddOidcCore`\) and differ only in the transport layer:
where the MVC package registers controllers, this package maps route handlers through
[MapOidcEndpoints\(this IEndpointRouteBuilder, string\)](https://www.abblix.com/en/docs/api/abblix-oidc-server-minimalapi/Abblix.Oidc.Server.MinimalApi.EndpointRouteBuilderExtensions#Abblix.Oidc.Server.MinimalApi.EndpointRouteBuilderExtensions.MapOidcEndpoints(thisMicrosoft.AspNetCore.Routing.IEndpointRouteBuilder,string) 'Abblix\.Oidc\.Server\.MinimalApi\.EndpointRouteBuilderExtensions\.MapOidcEndpoints\(this Microsoft\.AspNetCore\.Routing\.IEndpointRouteBuilder, string\)')\.
### Methods

## ServiceCollectionExtensions\.AddOidcMinimalApi\(this IServiceCollection\) Method {#Abblix.Oidc.Server.MinimalApi.ServiceCollectionExtensions.AddOidcMinimalApi(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection)}

Adds the Minimal API transport services for the OpenID Connect server\. Assumes the core services
\(`AddOidcCore`\) are registered separately\. The counterpart of the MVC integration's
`AddOidcMvc()`\.

```csharp
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddOidcMinimalApi(this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
```
#### 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.MinimalApi.ServiceCollectionExtensions.AddOidcMinimalApi(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection).services}

The service collection to add the services to\.

#### Returns
[Microsoft\.Extensions\.DependencyInjection\.IServiceCollection](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection 'Microsoft\.Extensions\.DependencyInjection\.IServiceCollection')  
The same [Microsoft\.Extensions\.DependencyInjection\.IServiceCollection](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection 'Microsoft\.Extensions\.DependencyInjection\.IServiceCollection') so calls can be chained\.

## ServiceCollectionExtensions\.AddOidcServices\(this IServiceCollection, Action\<OidcOptions,IServiceProvider\>\) Method {#Abblix.Oidc.Server.MinimalApi.ServiceCollectionExtensions.AddOidcServices(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection,System.Action_Abblix.Oidc.Server.Common.Configuration.OidcOptions,System.IServiceProvider_)}

Adds the OpenID Connect server \(core plus the Minimal API transport\) and configures its options with access
to the service provider\.

```csharp
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddOidcServices(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action<Abblix.Oidc.Server.Common.Configuration.OidcOptions,System.IServiceProvider> configureOptions);
```
#### 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.MinimalApi.ServiceCollectionExtensions.AddOidcServices(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection,System.Action_Abblix.Oidc.Server.Common.Configuration.OidcOptions,System.IServiceProvider_).services}

The service collection to add the services to\.

###### `configureOptions` [System\.Action&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.action-2 'System\.Action\`2')[OidcOptions](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Configuration.OidcOptions 'Abblix\.Oidc\.Server\.Common\.Configuration\.OidcOptions')[,](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')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.action-2 'System\.Action\`2') {#Abblix.Oidc.Server.MinimalApi.ServiceCollectionExtensions.AddOidcServices(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection,System.Action_Abblix.Oidc.Server.Common.Configuration.OidcOptions,System.IServiceProvider_).configureOptions}

A delegate that configures the [OidcOptions](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Configuration.OidcOptions 'Abblix\.Oidc\.Server\.Common\.Configuration\.OidcOptions')\.

#### Returns
[Microsoft\.Extensions\.DependencyInjection\.IServiceCollection](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection 'Microsoft\.Extensions\.DependencyInjection\.IServiceCollection')  
The same [Microsoft\.Extensions\.DependencyInjection\.IServiceCollection](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection 'Microsoft\.Extensions\.DependencyInjection\.IServiceCollection') so calls can be chained\.

## ServiceCollectionExtensions\.AddOidcServices\(this IServiceCollection, Action\<OidcOptions\>\) Method {#Abblix.Oidc.Server.MinimalApi.ServiceCollectionExtensions.AddOidcServices(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection,System.Action_Abblix.Oidc.Server.Common.Configuration.OidcOptions_)}

Adds the OpenID Connect server \(core plus the Minimal API transport\) and configures its options\.

```csharp
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddOidcServices(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action<Abblix.Oidc.Server.Common.Configuration.OidcOptions> configureOptions);
```
#### 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.MinimalApi.ServiceCollectionExtensions.AddOidcServices(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection,System.Action_Abblix.Oidc.Server.Common.Configuration.OidcOptions_).services}

The service collection to add the services to\.

###### `configureOptions` [System\.Action&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.action-1 'System\.Action\`1')[OidcOptions](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Configuration.OidcOptions 'Abblix\.Oidc\.Server\.Common\.Configuration\.OidcOptions')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.action-1 'System\.Action\`1') {#Abblix.Oidc.Server.MinimalApi.ServiceCollectionExtensions.AddOidcServices(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection,System.Action_Abblix.Oidc.Server.Common.Configuration.OidcOptions_).configureOptions}

A delegate that configures the [OidcOptions](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Configuration.OidcOptions 'Abblix\.Oidc\.Server\.Common\.Configuration\.OidcOptions')\.

#### Returns
[Microsoft\.Extensions\.DependencyInjection\.IServiceCollection](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection 'Microsoft\.Extensions\.DependencyInjection\.IServiceCollection')  
The same [Microsoft\.Extensions\.DependencyInjection\.IServiceCollection](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection 'Microsoft\.Extensions\.DependencyInjection\.IServiceCollection') so calls can be chained\.

### Remarks
Named exactly as the MVC integration names it, so moving a host from one adapter to the other leaves
this line alone: what changes is the package reference and the endpoint mapping, not the registration\.
