OneIdentity.SafeguardDotNet 8.2.2

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package OneIdentity.SafeguardDotNet --version 8.2.2
                    
NuGet\Install-Package OneIdentity.SafeguardDotNet -Version 8.2.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OneIdentity.SafeguardDotNet" Version="8.2.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OneIdentity.SafeguardDotNet" Version="8.2.2" />
                    
Directory.Packages.props
<PackageReference Include="OneIdentity.SafeguardDotNet" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OneIdentity.SafeguardDotNet --version 8.2.2
                    
#r "nuget: OneIdentity.SafeguardDotNet, 8.2.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OneIdentity.SafeguardDotNet@8.2.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OneIdentity.SafeguardDotNet&version=8.2.2
                    
Install as a Cake Addin
#tool nuget:?package=OneIdentity.SafeguardDotNet&version=8.2.2
                    
Install as a Cake Tool

SafeguardDotNet

One Identity Safeguard Web API .NET SDK

Overview

SafeguardDotNet provides a comprehensive .NET SDK for interacting with the One Identity Safeguard for Privileged Passwords API. This library simplifies authentication, API calls, and event handling, allowing you to integrate Safeguard functionality into your .NET applications with minimal code.

Key Features

  • Multiple Authentication Methods

    • Username/Password authentication
    • Client certificate authentication (PFX/PEM or certificate store)
    • API token authentication
    • Anonymous access for public endpoints
  • Full API Coverage

    • Access all Safeguard services (Core, Appliance, A2A, Notification)
    • Support for v3 and v4 APIs (v4 is default)
    • Simple method invocation with InvokeMethod()
  • A2A (Application-to-Application) Support

    • Certificate-based password retrieval for automated integrations
    • Access request brokering on behalf of users
    • No manual approval workflow required for configured A2A registrations
  • Real-Time Event Notifications

    • Subscribe to Safeguard events via SignalR
    • Persistent event listeners with auto-reconnect capabilities
    • Role-based notifications for assets, accounts, access requests, and more
  • Production-Ready Features

    • Automatic token refresh for long-running connections
    • Built-in logging via Serilog integration
    • Comprehensive error handling with SafeguardDotNetException

Quick Start

Installation

dotnet add package OneIdentity.SafeguardDotNet

Basic Usage

using OneIdentity.SafeguardDotNet;
using System.Security;

// Connect with username/password
SecureString password = GetPasswordSecurely();
var connection = Safeguard.Connect("safeguard.company.com", "local", "Admin", password);

// Call the API
string userData = connection.InvokeMethod(Service.Core, Method.Get, "Me");
Console.WriteLine(userData);

Certificate Authentication

// Using certificate thumbprint from store
var connection = Safeguard.Connect("safeguard.company.com", "756766BB590D7FA9CA9E1971A4AE41BB9CEC82F1");

// Using PFX file
SecureString certPassword = GetPasswordSecurely();
var connection = Safeguard.Connect("safeguard.company.com", @"C:\certs\client.pfx", certPassword);

A2A Password Retrieval

// Get A2A context with certificate
var a2aContext = Safeguard.A2A.GetContext("safeguard.company.com", @"C:\certs\a2a.pfx", certPassword, apiKey);

// Retrieve password
var password = a2aContext.RetrievePassword();

Event Notifications

// Create persistent event listener (auto-reconnects)
var listener = connection.GetPersistentEventListener();

listener.RegisterEventHandler("AssetAccountPasswordUpdated", (eventName, eventBody) => {
    Console.WriteLine($"Password changed: {eventBody}");
});

listener.Start();

API Versions

SafeguardDotNet defaults to the v4 API. To use v3:

var connection = Safeguard.Connect("safeguard.company.com", "local", "Admin", password, apiVersion: 3);

Safeguard 7.X+ hosts both v3 and v4 APIs simultaneously.

Target Framework

  • netstandard2.0 - Compatible with .NET Framework 4.6.1+, .NET Core 2.0+, .NET 5+, and .NET 6+

Documentation

Support

This project is supported through:

License

Licensed under Apache 2.0

Copyright (c) 2026 One Identity LLC. All rights reserved.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on OneIdentity.SafeguardDotNet:

Package Downloads
OneIdentity.SafeguardDotNet.BrowserLogin

Browser Login for One Identity Safeguard Web API .NET SDK

OneIdentity.SafeguardDotNet.PkceNoninteractiveLogin

PKCE Non-interactive Login for One Identity Safeguard Web API .NET SDK

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.2.3-dev-25208 62 3/19/2026
8.2.3-dev-24706 121 3/17/2026
8.2.3-dev-24700 123 3/17/2026
8.2.3-dev-23900 158 3/11/2026
8.2.3-dev-23099 159 3/6/2026
8.2.3-dev-23053 154 3/6/2026
8.2.2 314 3/5/2026
8.2.1 226 3/3/2026
8.2.1-dev-22051 165 3/2/2026
8.2.1-dev-22043 160 3/2/2026
8.2.0 5,608 9/9/2025
8.2.0-dev-19047 167 2/11/2026
8.1.1 797 6/19/2025
8.1.0 944 3/5/2025
8.1.0-dev-25849 204 2/24/2025
8.0.0-dev-45097 186 6/6/2025
8.0.0-dev-38866 370 5/3/2025
8.0.0-dev-19043 166 2/11/2026
8.0.0-dev-19035 133 2/11/2026
8.0.0-dev-14930 222 12/2/2024
Loading failed

One Identity Safeguard Web API .NET SDK

Provides an easy way to connect to Safeguard and call the Safeguard API.
- Password and client certificate authentication
- A2A API support, including access request broker
- Real-time event notifications
- Persistent event listeners that reconnect even after an appliance goes offline

Updates:
- Bug fixes and dependency updates.