Ahwoo.SessionTickets.Client 1.0.0

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

Ahwoo.SessionTickets.Client

Use this package to identify the Ahwoo account that a player of your game is signed in to.

The player signs in once in the Ahwoo desktop client, a separate Windows application. Your game asks that client for a session ticket, a short-lived signed assertion of the player's identity. Your game then sends the ticket to your game server, which verifies it with Ahwoo.SessionTickets.Server and reads the player's Ahwoo profile ID. Your game shows no sign-in screen of its own.

This package is the game side of that exchange. It has no third-party dependencies.

dotnet add package Ahwoo.SessionTickets.Client

How the exchange works

  1. The player's game connects to your game server. Your game server generates a nonce, a single-use random challenge value, and sends it to the game.
  2. Your game calls this package, which asks the Ahwoo desktop client on the player's computer to mint a ticket bound to that nonce.
  3. The Ahwoo desktop client returns the ticket to your game. Your game sends the ticket to your game server over your game's own network connection. Ahwoo provides no transport for this step.
  4. Your game server verifies the ticket with Ahwoo.SessionTickets.Server and reads the player's Ahwoo profile ID.

Minting a ticket

using Ahwoo.SessionTickets.Client;
using Ahwoo.SessionTickets.Client.Models;

// Create one minter per process and keep it for the lifetime of the process.
private readonly SessionTicketMinter _ahwoo = new();

// Call this per connection attempt, with the nonce your game server sent.
async Task JoinAsync(string nonce, CancellationToken cancellationToken)
{
    if (!_ahwoo.IsAhwooClientRunning)
    {
        ShowAhwooClientRequired();
        return;
    }

    SessionTicket ticket = await _ahwoo.MintAsync(nonce, cancellationToken);
    SendToServer(ticket.Token);
}

IsAhwooClientRunning reports whether the Ahwoo desktop client is running on the player's computer. Check this property before your game attempts to connect. Your game can then ask the player to start the Ahwoo desktop client, or fall back to another identity system.

A ticket expires about 120 seconds after your game mints it, and it is bound to one nonce. Mint a ticket for each connection attempt. Do not mint at startup, and do not cache a ticket.

When minting fails

The exceptions below live in Ahwoo.SessionTickets.Client.Exceptions and derive from SessionTicketException. Catch SessionTicketException to handle every minting failure the same way, such as to abandon the connection attempt.

Exception Cause Message for the player
AhwooClientNotRunningException The Ahwoo desktop client is not running. "Start the Ahwoo client to play online."
AhwooClientSignedOutException The Ahwoo desktop client is running, but no player is signed in. "Sign in to Ahwoo to play online."
AhwooClientOfflineException The player set the Ahwoo desktop client to offline mode. "Ahwoo is in offline mode."
AhwooApiUnreachableException The Ahwoo desktop client could not reach Ahwoo. Retrying is worthwhile. "Couldn't reach Ahwoo. Try again."
SessionTicketMintFailedException The mint failed for another reason. StatusCode holds the status the Ahwoo desktop client returned. Log the exception. "Something went wrong. Try again."

Configuration

This package requires no configuration.

Option Default Description
DiscoveryFilePath Ahwoo\Client\broker.json in the per-user local application data folder The file that the Ahwoo desktop client advertises itself in
Timeout 30 seconds How long the minter waits for the Ahwoo desktop client to answer a mint
var minter = new SessionTicketMinter(new SessionTicketMinterOptions { Timeout = TimeSpan.FromSeconds(10) });

The constructor also accepts an HttpClient if your game manages its own. Use the ISessionTicketMinter interface to substitute the minter in your own tests.

How discovery works

The Ahwoo desktop client writes a discovery file while it runs, and deletes the file when it exits. The file names a loopback URL and a secret that the Ahwoo desktop client generates fresh on each run. The minter reads the file from the per-user local application data folder. On Windows, the default path is %LOCALAPPDATA%\Ahwoo\Client\broker.json. Set the DiscoveryFilePath option to read the file from another path.

The minter reads the discovery file on every mint. Your game therefore keeps working when the player restarts the Ahwoo desktop client or switches Ahwoo account. Neither case needs extra code in your game.

Trust boundary

The player's Ahwoo access token stays inside the Ahwoo desktop client and never enters your game process. Your game holds only a session ticket, which grants no access to Ahwoo's APIs.

Any process that runs as the desktop user can read the discovery file and mint a ticket. This is intentional. The operating system user account is the trust boundary, the same boundary that Steam and Discord use for their local inter-process channels. Such a process can already read the credentials that the Ahwoo desktop client stores. A session ticket lasts about 120 seconds and opens no Ahwoo API. It grants such a process no capability that the process does not already have.

Support

Email contact@ahwoo.com with questions or bug reports.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.
  • net10.0

    • No dependencies.

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.0 133 8/19/2026