FreeIPA.DotNet 1.0.1

dotnet add package FreeIPA.DotNet --version 1.0.1
NuGet\Install-Package FreeIPA.DotNet -Version 1.0.1
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="FreeIPA.DotNet" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FreeIPA.DotNet --version 1.0.1
#r "nuget: FreeIPA.DotNet, 1.0.1"
#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.
// Install FreeIPA.DotNet as a Cake Addin
#addin nuget:?package=FreeIPA.DotNet&version=1.0.1

// Install FreeIPA.DotNet as a Cake Tool
#tool nuget:?package=FreeIPA.DotNet&version=1.0.1

FreeIPA.DotNet

FreeIPA.DotNet is a client library for interacting with the FreeIPA API on the .NET platform. This library simplifies the HTTP requests required to communicate with a FreeIPA server.

Installation

You can add FreeIPA.DotNet to your project using the NuGet package manager. Search for FreeIPA.DotNet in the package manager and add it to your project.

Alternatively, you can use the .NET CLI to add the library to your project by running the following command:

NuGet latest release

You can add this library to your project using NuGet.

Package Manager Console Run the following command in the “Package Manager Console”:

PM> Install-Package FreeIPA.DotNet

Visual Studio Right click to your project in Visual Studio, choose “Manage NuGet Packages” and search for ‘FreeIPA.DotNet’ and click ‘Install’. (see NuGet Gallery...)

.NET Core Command Line Interface Run the following command from your favorite shell or terminal:

dotnet add package FreeIPA.DotNet

Usage

Below are examples of basic usage for the FreeIPA.DotNet library.

Creating a Client

using FreeIPA.DotNet;

var ipaClient = new IpaClient("https://ipa-server.example.com");

When creating a client, provide the base URL of your FreeIPA server.

Logging in with Password

using FreeIPA.DotNet.Models.Login;

var loginResult = await ipaClient.LoginWithPassword(new IpaLoginRequestModel
{
    Username = "admin",
    Password = "password123"
});

if (loginResult.Success)
{
    // Login successful
}
else
{
    // Login failed, check the error message
    var errorMessage = loginResult.Data.Message;
    Console.WriteLine($"Login failed: {errorMessage}");
}

To log in with a password, use the LoginWithPassword method. If the login is successful, the Success property will be true, and the response details will be available in the Data property. If the login fails, you can retrieve the error message from Data.Message.

Sending an RPC Request

using FreeIPA.DotNet.Models.RPC;

var rpcRequest = new IpaRpcRequestModel
{
    Method = "env",
    Parameters = new object[] { Array.Empty<string>(), new { } },
    Id = 0
};

var rpcResult = await ipaClient.SendRpcRequest(rpcRequest);

if (rpcResult.Success)
{
    // RPC request successful, use the results
    var response = rpcResult.Data;
    Console.WriteLine($"RPC response: {response}");
}
else
{
    // RPC request failed, check the error message
    var errorMessage = rpcResult.Data.Message;
    Console.WriteLine($"RPC request failed: {errorMessage}");
}

To send an RPC request, use the SendRpcRequest method. If the request is successful, the Success property will be true, and the response details will be available in the Data property. If the request fails, you can retrieve the error message from Data.Message.

License

This project is licensed under the MIT License. For more information, see the LICENSE file.

Issues, Feature Requests or Support

Please use the New Issue button to submit issues, feature requests or support issues directly to me. You can also send an e-mail to akin.bicer@outlook.com.tr.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 216 7/8/2023
1.0.0 124 7/4/2023

- Added user actions.
- Added custom transaction messages.