Nedo.AspNet.PddiktiLibrary 1.1.0

dotnet add package Nedo.AspNet.PddiktiLibrary --version 1.1.0
                    
NuGet\Install-Package Nedo.AspNet.PddiktiLibrary -Version 1.1.0
                    
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="Nedo.AspNet.PddiktiLibrary" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nedo.AspNet.PddiktiLibrary" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Nedo.AspNet.PddiktiLibrary" />
                    
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 Nedo.AspNet.PddiktiLibrary --version 1.1.0
                    
#r "nuget: Nedo.AspNet.PddiktiLibrary, 1.1.0"
                    
#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 Nedo.AspNet.PddiktiLibrary@1.1.0
                    
#: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=Nedo.AspNet.PddiktiLibrary&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Nedo.AspNet.PddiktiLibrary&version=1.1.0
                    
Install as a Cake Tool

Nedo.AspNet.PddiktiLibrary

A .NET 9 client for the PDDIKTI (Neo Feeder) API. It hides the token dance behind a typed client and exposes each feeder module — Mahasiswa, Dosen, Nilai, KelasKuliah, Kurikulum, Referensi and the rest — as its own endpoint group.

Moved here from pens-pddikti-library (September 2026), where it was written for the PENS project. The code is the same; the namespace is now Nedo.AspNet.PddiktiLibrary and the sample no longer carries credentials. History was not imported — the old repository has a live feeder password in it, and copying that into a shared library was not worth the convenience of git log.

Features

  • Automatic authentication: GetToken is handled transparently and the token cached for subsequent requests.
  • Typed execution: ExecuteAsync<T> maps feeder responses onto DTOs.
  • Dependency injection: registers through Microsoft.Extensions.DependencyInjection.
  • Configurable: options through the IOptions pattern.

Getting started

Add a project reference to src/Nedo.AspNet.PddiktiLibrary/Nedo.AspNet.PddiktiLibrary.csproj, then register the client:

using Nedo.AspNet.PddiktiLibrary.Extensions;

services.AddPddiktiClient(options =>
{
    options.BaseUrl = "http://your-pddikti-url/ws/live2.php";
    options.Username = "...";
    options.Password = "...";
    options.TimeoutSeconds = 60;   // optional, default 30
});

Never write those values as literals. Bind them from configuration — the options class carries its own section name for exactly that:

services.AddPddiktiClient(options =>
    configuration.GetSection(PddiktiClientOptions.SectionName).Bind(options));

Usage

Inject IPddiktiClient and reach a module through its property:

public class MyService(IPddiktiClient client)
{
    public async Task GetUniversityProfile()
    {
        var data = await client.Base.GetProfilPTAsync(limit: 1);

        foreach (var profile in data ?? [])
            Console.WriteLine($"University: {profile.NamaPerguruanTinggi}");
    }
}

Project structure

src/Nedo.AspNet.PddiktiLibrary/          the client
  Config/                                PddiktiClientOptions
  Extensions/                            AddPddiktiClient
  Models/<Module>/                       request + response DTOs per feeder module
  Modules/                               one endpoint group per module, interface + implementation
src/Nedo.AspNet.PddiktiLibrary.Tests/    xUnit + Moq, HTTP handler mocked
src/Nedo.AspNet.PddiktiLibrary.Sample/   console app exercising the endpoints by hand

Sample application

The sample reads its credentials from configuration and refuses to start without them — it will never reach a live feeder by accident. Host.CreateDefaultBuilder already loads environment variables and user-secrets, so either works:

# environment variables (note the double underscore)
setx Pddikti__BaseUrl  "http://your-pddikti-url/ws/live2.php"
setx Pddikti__Username "..."
setx Pddikti__Password "..."

# or user-secrets, which keep the password out of your shell history and environment
dotnet user-secrets init  --project src/Nedo.AspNet.PddiktiLibrary.Sample
dotnet user-secrets set   --project src/Nedo.AspNet.PddiktiLibrary.Sample "Pddikti:BaseUrl"  "..."
dotnet user-secrets set   --project src/Nedo.AspNet.PddiktiLibrary.Sample "Pddikti:Username" "..."
dotnet user-secrets set   --project src/Nedo.AspNet.PddiktiLibrary.Sample "Pddikti:Password" "..."

dotnet run --project src/Nedo.AspNet.PddiktiLibrary.Sample

Unconfigured, it prints which settings are missing and exits 78 (EX_CONFIG).

The sample writes whatever the feeder returns to the console, which for most endpoints is real student and staff data. Do not commit its output.

Postman collection

pddikti_collection.json is the feeder's own collection, importable as-is. The live one is served by your feeder at:

https://<your-pddikti-url>:3003/ws/postman

Tests

dotnet test Nedo.AspNet.PddiktiLibrary.sln

32 tests, all against a mocked HttpMessageHandler — nothing reaches a real feeder.

License

MIT.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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. 
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.1.0 260 9/9/2026
1.0.0 190 9/1/2026