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

## OidcResults Class

Turns an OAuth/OIDC error into an [Microsoft\.AspNetCore\.Http\.IResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult 'Microsoft\.AspNetCore\.Http\.IResult') and decorates results with headers, mirroring the MVC
integration's `ActionResultExtensions` so both adapters emit identical HTTP error shapes\.

```csharp
public static class OidcResults
```

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

## OidcResults\.Format\(this OidcError, int, string\) Method {#Abblix.Oidc.Server.MinimalApi.OidcResults.Format(thisAbblix.Oidc.Server.Common.OidcError,int,string)}

Formats an [OidcError](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.OidcError 'Abblix\.Oidc\.Server\.Common\.OidcError') as an HTTP error response per RFC 6750 §3 / RFC 6749 §5\.2:
`invalid_token` returns 401 with a `WWW-Authenticate` Bearer challenge and no body;
`insufficient_scope` returns 403 with the header; `invalid_client` returns 401 with a Basic challenge
and the JSON error body; everything else uses the fallback status code with a JSON body\.

```csharp
public static Microsoft.AspNetCore.Http.IResult Format(this Abblix.Oidc.Server.Common.OidcError error, int fallbackStatusCode, string? realm=null);
```
#### Parameters

###### `error` [OidcError](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.OidcError 'Abblix\.Oidc\.Server\.Common\.OidcError') {#Abblix.Oidc.Server.MinimalApi.OidcResults.Format(thisAbblix.Oidc.Server.Common.OidcError,int,string).error}

###### `fallbackStatusCode` [System\.Int32](https://learn.microsoft.com/en-us/dotnet/api/system.int32 'System\.Int32') {#Abblix.Oidc.Server.MinimalApi.OidcResults.Format(thisAbblix.Oidc.Server.Common.OidcError,int,string).fallbackStatusCode}

###### `realm` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.MinimalApi.OidcResults.Format(thisAbblix.Oidc.Server.Common.OidcError,int,string).realm}

#### Returns
[Microsoft\.AspNetCore\.Http\.IResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult 'Microsoft\.AspNetCore\.Http\.IResult')

## OidcResults\.Format\(this OidcError, int, string, IEnumerable\<string\>, bool\) Method {#Abblix.Oidc.Server.MinimalApi.OidcResults.Format(thisAbblix.Oidc.Server.Common.OidcError,int,string,System.Collections.Generic.IEnumerable_string_,bool)}

Formats an [OidcError](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.OidcError 'Abblix\.Oidc\.Server\.Common\.OidcError') as an HTTP error response that advertises the DPoP scheme \(RFC 9449 §7\.1\) on
the `WWW-Authenticate` header, optionally alongside Bearer\. [UseDPoPNonceError](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.UseDPoPNonceError 'Abblix\.Oidc\.Server\.Common\.UseDPoPNonceError') additionally
emits the `DPoP-Nonce` header so the client can echo the freshly issued nonce on retry\.

```csharp
public static Microsoft.AspNetCore.Http.IResult Format(this Abblix.Oidc.Server.Common.OidcError error, int fallbackStatusCode, string? realm, System.Collections.Generic.IEnumerable<string> dpopAlgs, bool advertiseBearer);
```
#### Parameters

###### `error` [OidcError](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.OidcError 'Abblix\.Oidc\.Server\.Common\.OidcError') {#Abblix.Oidc.Server.MinimalApi.OidcResults.Format(thisAbblix.Oidc.Server.Common.OidcError,int,string,System.Collections.Generic.IEnumerable_string_,bool).error}

###### `fallbackStatusCode` [System\.Int32](https://learn.microsoft.com/en-us/dotnet/api/system.int32 'System\.Int32') {#Abblix.Oidc.Server.MinimalApi.OidcResults.Format(thisAbblix.Oidc.Server.Common.OidcError,int,string,System.Collections.Generic.IEnumerable_string_,bool).fallbackStatusCode}

###### `realm` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.MinimalApi.OidcResults.Format(thisAbblix.Oidc.Server.Common.OidcError,int,string,System.Collections.Generic.IEnumerable_string_,bool).realm}

###### `dpopAlgs` [System\.Collections\.Generic\.IEnumerable&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1 'System\.Collections\.Generic\.IEnumerable\`1')[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1 'System\.Collections\.Generic\.IEnumerable\`1') {#Abblix.Oidc.Server.MinimalApi.OidcResults.Format(thisAbblix.Oidc.Server.Common.OidcError,int,string,System.Collections.Generic.IEnumerable_string_,bool).dpopAlgs}

###### `advertiseBearer` [System\.Boolean](https://learn.microsoft.com/en-us/dotnet/api/system.boolean 'System\.Boolean') {#Abblix.Oidc.Server.MinimalApi.OidcResults.Format(thisAbblix.Oidc.Server.Common.OidcError,int,string,System.Collections.Generic.IEnumerable_string_,bool).advertiseBearer}

#### Returns
[Microsoft\.AspNetCore\.Http\.IResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult 'Microsoft\.AspNetCore\.Http\.IResult')

## OidcResults\.WithAntiFramingHeaders\(this IResult\) Method {#Abblix.Oidc.Server.MinimalApi.OidcResults.WithAntiFramingHeaders(thisMicrosoft.AspNetCore.Http.IResult)}

Decorates a self\-rendered HTML result \(the form\_post auto\-submit page\) with the anti\-framing headers so it
can never be embedded in another origin's frame \(clickjacking defense, RFC 9700 Section 4\.16\)\. The check\_session
page cannot use this path: its CSP carries a per\-request nonce generated inside the result, so it sets the
header itself\.

```csharp
public static Microsoft.AspNetCore.Http.IResult WithAntiFramingHeaders(this Microsoft.AspNetCore.Http.IResult inner);
```
#### Parameters

###### `inner` [Microsoft\.AspNetCore\.Http\.IResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult 'Microsoft\.AspNetCore\.Http\.IResult') {#Abblix.Oidc.Server.MinimalApi.OidcResults.WithAntiFramingHeaders(thisMicrosoft.AspNetCore.Http.IResult).inner}

#### Returns
[Microsoft\.AspNetCore\.Http\.IResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult 'Microsoft\.AspNetCore\.Http\.IResult')

## OidcResults\.WithAppendCookie\(this IResult, string, string, CookieOptions\) Method {#Abblix.Oidc.Server.MinimalApi.OidcResults.WithAppendCookie(thisMicrosoft.AspNetCore.Http.IResult,string,string,Microsoft.AspNetCore.Http.CookieOptions)}

Decorates a result to append a cookie to the response before the inner result executes\.

```csharp
public static Microsoft.AspNetCore.Http.IResult WithAppendCookie(this Microsoft.AspNetCore.Http.IResult inner, string name, string value, Microsoft.AspNetCore.Http.CookieOptions options);
```
#### Parameters

###### `inner` [Microsoft\.AspNetCore\.Http\.IResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult 'Microsoft\.AspNetCore\.Http\.IResult') {#Abblix.Oidc.Server.MinimalApi.OidcResults.WithAppendCookie(thisMicrosoft.AspNetCore.Http.IResult,string,string,Microsoft.AspNetCore.Http.CookieOptions).inner}

###### `name` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.MinimalApi.OidcResults.WithAppendCookie(thisMicrosoft.AspNetCore.Http.IResult,string,string,Microsoft.AspNetCore.Http.CookieOptions).name}

###### `value` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.MinimalApi.OidcResults.WithAppendCookie(thisMicrosoft.AspNetCore.Http.IResult,string,string,Microsoft.AspNetCore.Http.CookieOptions).value}

###### `options` [Microsoft\.AspNetCore\.Http\.CookieOptions](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.cookieoptions 'Microsoft\.AspNetCore\.Http\.CookieOptions') {#Abblix.Oidc.Server.MinimalApi.OidcResults.WithAppendCookie(thisMicrosoft.AspNetCore.Http.IResult,string,string,Microsoft.AspNetCore.Http.CookieOptions).options}

#### Returns
[Microsoft\.AspNetCore\.Http\.IResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult 'Microsoft\.AspNetCore\.Http\.IResult')

## OidcResults\.WithDeleteCookie\(this IResult, string, CookieOptions\) Method {#Abblix.Oidc.Server.MinimalApi.OidcResults.WithDeleteCookie(thisMicrosoft.AspNetCore.Http.IResult,string,Microsoft.AspNetCore.Http.CookieOptions)}

Decorates a result to delete a cookie from the response before the inner result executes\.

```csharp
public static Microsoft.AspNetCore.Http.IResult WithDeleteCookie(this Microsoft.AspNetCore.Http.IResult inner, string name, Microsoft.AspNetCore.Http.CookieOptions options);
```
#### Parameters

###### `inner` [Microsoft\.AspNetCore\.Http\.IResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult 'Microsoft\.AspNetCore\.Http\.IResult') {#Abblix.Oidc.Server.MinimalApi.OidcResults.WithDeleteCookie(thisMicrosoft.AspNetCore.Http.IResult,string,Microsoft.AspNetCore.Http.CookieOptions).inner}

###### `name` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.MinimalApi.OidcResults.WithDeleteCookie(thisMicrosoft.AspNetCore.Http.IResult,string,Microsoft.AspNetCore.Http.CookieOptions).name}

###### `options` [Microsoft\.AspNetCore\.Http\.CookieOptions](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.cookieoptions 'Microsoft\.AspNetCore\.Http\.CookieOptions') {#Abblix.Oidc.Server.MinimalApi.OidcResults.WithDeleteCookie(thisMicrosoft.AspNetCore.Http.IResult,string,Microsoft.AspNetCore.Http.CookieOptions).options}

#### Returns
[Microsoft\.AspNetCore\.Http\.IResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult 'Microsoft\.AspNetCore\.Http\.IResult')

## OidcResults\.WithHeader\(this IResult, string, string\) Method {#Abblix.Oidc.Server.MinimalApi.OidcResults.WithHeader(thisMicrosoft.AspNetCore.Http.IResult,string,string)}

Decorates a result to set a response header before the inner result executes\.

```csharp
public static Microsoft.AspNetCore.Http.IResult WithHeader(this Microsoft.AspNetCore.Http.IResult inner, string name, string value);
```
#### Parameters

###### `inner` [Microsoft\.AspNetCore\.Http\.IResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult 'Microsoft\.AspNetCore\.Http\.IResult') {#Abblix.Oidc.Server.MinimalApi.OidcResults.WithHeader(thisMicrosoft.AspNetCore.Http.IResult,string,string).inner}

###### `name` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.MinimalApi.OidcResults.WithHeader(thisMicrosoft.AspNetCore.Http.IResult,string,string).name}

###### `value` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.MinimalApi.OidcResults.WithHeader(thisMicrosoft.AspNetCore.Http.IResult,string,string).value}

#### Returns
[Microsoft\.AspNetCore\.Http\.IResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult 'Microsoft\.AspNetCore\.Http\.IResult')

## OidcResults\.WithHeader\(this IResult, string, IEnumerable\<string\>\) Method {#Abblix.Oidc.Server.MinimalApi.OidcResults.WithHeader(thisMicrosoft.AspNetCore.Http.IResult,string,System.Collections.Generic.IEnumerable_string_)}

Decorates a result to append each value as a separate header line under the same name\.

```csharp
public static Microsoft.AspNetCore.Http.IResult WithHeader(this Microsoft.AspNetCore.Http.IResult inner, string name, System.Collections.Generic.IEnumerable<string> values);
```
#### Parameters

###### `inner` [Microsoft\.AspNetCore\.Http\.IResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult 'Microsoft\.AspNetCore\.Http\.IResult') {#Abblix.Oidc.Server.MinimalApi.OidcResults.WithHeader(thisMicrosoft.AspNetCore.Http.IResult,string,System.Collections.Generic.IEnumerable_string_).inner}

###### `name` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.MinimalApi.OidcResults.WithHeader(thisMicrosoft.AspNetCore.Http.IResult,string,System.Collections.Generic.IEnumerable_string_).name}

###### `values` [System\.Collections\.Generic\.IEnumerable&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1 'System\.Collections\.Generic\.IEnumerable\`1')[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1 'System\.Collections\.Generic\.IEnumerable\`1') {#Abblix.Oidc.Server.MinimalApi.OidcResults.WithHeader(thisMicrosoft.AspNetCore.Http.IResult,string,System.Collections.Generic.IEnumerable_string_).values}

#### Returns
[Microsoft\.AspNetCore\.Http\.IResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult 'Microsoft\.AspNetCore\.Http\.IResult')
