---
title: "Biometric sessions - Rest PKI Core - .NET/C# Client Lib"
description: "How to set up the Rest PKI Core .NET library (.NET Standard 2.0) and use IRestBioService for biometric sessions in an ASP.NET Core application."
canonical: "https://docs.lacunasoftware.com/en-us/articles/rest-pki/core/integration/bio-sessions/client-libs/dotnet"
locale: "en"
product: "Rest PKI Core"
last_updated: "2026-10-12"
---

# Biometric sessions - Rest PKI Core - .NET/C# Client Lib

Before exploring the use cases, you need to set up the Rest PKI Core library in your application. The `Lacuna.RestPkiCore.Client` library is
compatible with .NET Standard 2.0. The examples below use ASP.NET Core, like the
[backend sample (.NET)](https://github.com/LacunaSoftware/RestBioSamples/tree/main/backend/dotnet), which uses .NET 8.

## 1. Environment setup

In your `appsettings.json` file, add the credentials obtained on the Rest PKI Core dashboard:

```json
{
  ...,
  "RestPki": {
    "Endpoint": "YOUR_ENDPOINT_HERE",
    "ApiKey": "YOUR_API_KEY_HERE"
  }
}
```

In the `Program.cs` file, register the service before the call to `builder.Build()`:

```cs
// Registers the Rest PKI Core client using the appsettings section
builder.Services.AddRestPki().Configure(builder.Configuration.GetSection("RestPki")); 

var app = builder.Build();
```

## 2. Dependency injection
To use the biometric features in your controllers, inject the `IRestBioService` interface through the constructor.

> **Note**
>
> The `IRestBioService` interface is the one responsible for all biometric session operations (liveness, enrollment, authentication, etc.).

```cs
using Lacuna.RestPki.Client;
using Microsoft.AspNetCore.Mvc;

[ApiController]
[Route("api/sessions")]
public class MyController : ControllerBase {

    private readonly IRestBioService _restBioService;
    
    public MyController(IRestBioService restBioService) {
        _restBioService = restBioService;
    }
    
    // The sample methods go here...
}
```

## See also

* [Backend sample (.NET)](https://github.com/LacunaSoftware/RestBioSamples/tree/main/backend/dotnet)
* [Samples repository (GitHub)](https://github.com/LacunaSoftware/RestBioSamples)
