Authlink.Portal.Client.Http
2.17.0
dotnet add package Authlink.Portal.Client.Http --version 2.17.0
NuGet\Install-Package Authlink.Portal.Client.Http -Version 2.17.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="Authlink.Portal.Client.Http" Version="2.17.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Authlink.Portal.Client.Http" Version="2.17.0" />
<PackageReference Include="Authlink.Portal.Client.Http" />
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 Authlink.Portal.Client.Http --version 2.17.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Authlink.Portal.Client.Http, 2.17.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 Authlink.Portal.Client.Http@2.17.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=Authlink.Portal.Client.Http&version=2.17.0
#tool nuget:?package=Authlink.Portal.Client.Http&version=2.17.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Package Overview
Authlink.Portal.Client.Http provides a ready-to-use, production-grade implementation of the IPortalClient abstraction defined in Authlink.Portal.Client.Core.
Install
dotnet add package Authlink.Portal.Client.Http
Or via Package Manager:
PM> Install-Package Authlink.Portal.Client.Http
What's New in v2.17.0
New Features - Agent Management:
20 new methods for managing AI agents:
| Category | Methods |
|---|---|
| CRUD | CreateAgentAsync, GetAgentAsync, GetAgentsAsync, UpdateAgentAsync, DeleteAgentAsync |
| Lifecycle | ActivateAgentAsync, DeactivateAgentAsync |
| Roles | GetAgentRolesAsync, AddAgentRoleAsync, RemoveAgentRoleAsync |
| Permissions | GetAgentPermissionsAsync, AddAgentPermissionAsync, RemoveAgentPermissionAsync |
| Policies | GetAgentPoliciesAsync, AddAgentPolicyAsync, RemoveAgentPolicyAsync |
| Attributes | GetAgentAttributesAsync, AddAgentAttributeAsync, UpdateAgentAttributeAsync, RemoveAgentAttributeAsync |
Example - Create and manage an agent:
// Create an agent
var createResult = await _client.CreateAgentAsync(new CreateAgentRequest
{
Name = "Trading Agent",
AgentType = AgentType.Delegated,
ConfidentialClientId = clientId,
AgentProvider = "Anthropic",
AgentModel = "claude-sonnet-4-20250514",
AgentVersion = "1.0.0"
});
// Add a permission to the agent
var addResult = await _client.AddAgentPermissionAsync(new AddAgentPermissionRequest
{
AgentId = createResult.Value.AgentId,
PermissionId = permissionId
});
// List agent permissions
var permsResult = await _client.GetAgentPermissionsAsync(new GetAgentPermissionsRequest
{
AgentId = agentId,
PageNumber = 1,
PageSize = 10
});
Example - Manage User Custom Data:
// Add custom data
await _client.AddUserCustomDataAsync(new AddUserCustomDataRequest
{
UserId = userId,
Key = "department",
Value = "Engineering"
});
// Remove custom data
await _client.RemoveUserCustomDataAsync(new RemoveUserCustomDataRequest
{
UserId = userId,
Key = "department"
});
See CHANGELOG.md for full version history.
Usage
Setup
builder.Services.AddPortalHttpClient(options =>
{
options.BaseUrl = "https://portal.authlink.co.za";
options.AccessToken = "your-access-token";
});
Basic Usage
public class MyService
{
private readonly IPortalClient _client;
public MyService(IPortalClient client)
{
_client = client;
}
public async Task GetUsersAsync()
{
var result = await _client.GetUsersAsync(new GetUsersRequest
{
PageNumber = 1,
PageSize = 10
});
if (result.IsError)
{
var error = result.FirstError;
Console.WriteLine($"Error: {error.Code} - {error.Description}");
return;
}
var response = result.Value;
Console.WriteLine($"Found {response.TotalCount} users");
}
}
Pattern Matching
var result = await _client.GetUserByIdAsync(new GetUserByIdRequest { UserId = userId });
return result.Match(
user => Ok(user),
errors => errors[0].Type switch
{
ErrorType.NotFound => NotFound(),
ErrorType.Unauthorized => Unauthorized(),
ErrorType.Forbidden => Forbid(),
_ => Problem(errors[0].Description)
}
);
Error Types
| Error Code | Error Type | HTTP Status | Description |
|---|---|---|---|
Portal.ValidationFailed |
Validation | 400 | Request validation failed |
Portal.Unauthorized |
Unauthorized | 401 | Authentication required |
Portal.Forbidden |
Forbidden | 403 | Insufficient permissions |
Portal.NotFound |
NotFound | 404 | Resource not found |
Portal.Conflict |
Conflict | 409 | Resource conflict |
Portal.Timeout |
Failure | 408 | Request timed out |
Portal.NetworkError |
Failure | - | Network/connection error |
Authentication Options
Option 1: Static Token (Recommended)
builder.Services.AddPortalHttpClient(options =>
{
options.BaseUrl = "https://portal.authlink.co.za";
options.AccessToken = configuration["Authlink:Portal:AccessToken"];
});
Option 2: Custom Token Provider
builder.Services.AddScoped<IAccessTokenProvider, MyTokenProvider>();
builder.Services.AddPortalHttpClient(options =>
{
options.BaseUrl = "https://portal.authlink.co.za";
});
Runtime Token Updates
if (_tokenProvider is MutableAccessTokenProvider mutableProvider)
{
mutableProvider.SetAccessToken(newToken);
}
Testing
The package includes comprehensive integration tests. See Integration Tests Documentation.
Documentation
License
MIT
| Product | Versions 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.
-
net9.0
- Authlink.Portal.Client.Core (>= 2.17.0)
- ErrorOr (>= 2.0.1)
- Microsoft.Extensions.DependencyInjection (>= 9.0.9)
- Microsoft.Extensions.Http (>= 9.0.9)
- Microsoft.Extensions.Options (>= 9.0.9)
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 |
|---|---|---|
| 2.17.0 | 121 | 5/19/2026 |
| 2.16.0 | 113 | 4/28/2026 |
| 2.15.0 | 101 | 4/24/2026 |
| 2.14.0 | 108 | 4/16/2026 |
| 2.13.0 | 109 | 3/26/2026 |
| 2.12.1 | 112 | 3/13/2026 |
| 2.12.0 | 117 | 3/12/2026 |
| 2.11.0 | 110 | 3/11/2026 |
| 2.10.0 | 107 | 3/6/2026 |
| 2.9.0 | 108 | 2/18/2026 |
| 2.8.0 | 111 | 2/18/2026 |
| 2.7.0 | 127 | 1/30/2026 |
| 2.6.0 | 112 | 1/29/2026 |
| 2.5.0 | 120 | 1/29/2026 |
| 2.4.0 | 113 | 1/28/2026 |
| 2.3.0 | 126 | 1/7/2026 |
| 2.2.4 | 112 | 1/7/2026 |
| 2.2.3 | 119 | 1/7/2026 |
| 2.2.2 | 314 | 11/12/2025 |
| 2.2.1 | 266 | 11/10/2025 |
Loading failed