Den.Dev.Conch 0.0.2

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

Conch

Conch

A tiny C#-based library to help authenticate against Xbox services.

This library is provided for educational and personal use purposes only. It comes with no guarantees, implied or otherwise.

By using this library, you acknowledge and agree to the following:

  • You interact with Xbox Live APIs at your own risk
  • Microsoft and Xbox may ban, suspend, or restrict accounts that use unofficial or unsanctioned APIs and projects (such as this library)
  • I bear no responsibility for any account bans, restrictions, suspensions, or other consequences that may result from using this library
  • You accept full responsibility for how you choose to use this library and any actions taken with it

About

Conch is an Xbox Live authentication library designed to handle the complexities of Microsoft's authentication flows. It was created to support Grunt, a command-line tool for interacting with Xbox Live services.

Key Capabilities

  • OAuth 2.0 Authentication - Generate authorization URLs and exchange codes for tokens
  • Token Management - Request and refresh OAuth tokens with scope customization
  • Xbox Live User Tokens - Acquire user authentication tickets
  • Device Tokens - Generate device tokens for XSTS authentication
  • XSTS Tokens - Request Xbox Live Security Token Service (XSTS) tokens
  • SISU Authentication - Support for SISU (Sign-In/Sign-Up) authentication flows
  • Proof-of-Possession (PoP) Signing - Cryptographic request signing for secure API calls

Installation

Install via NuGet:

dotnet add package Den.Dev.Conch

Or via the Package Manager Console:

Install-Package Den.Dev.Conch

Quick Start

using Den.Dev.Conch.Authentication;

// Create the authentication client
var authClient = new XboxAuthenticationClient();

// Generate an authorization URL for the user to visit
string authUrl = authClient.GenerateAuthUrl(
    clientId: "your-client-id",
    redirectUrl: "your-redirect-url"
);

// After user authorization, exchange the code for an OAuth token
var oauthToken = await authClient.RequestOAuthToken(
    clientId: "your-client-id",
    authorizationCode: "code-from-redirect",
    redirectUrl: "your-redirect-url"
);

// Request a user token
var userToken = await authClient.RequestUserToken(oauthToken.AccessToken);

// Request an XSTS token
var xstsToken = await authClient.RequestXstsToken(userToken.Token);

// Assemble the Xbox Live 3.0 token for API calls
string xblToken = authClient.GetXboxLiveV3Token(
    xstsToken.DisplayClaims.Xui[0].UserHash,
    xstsToken.Token
);

Using SISU Authentication

For scenarios requiring device and title tokens:

// Request a device token
var deviceToken = await authClient.RequestDeviceToken();

// Initialize a SISU session
var sisuSession = await authClient.RequestSISUSession(
    appId: "your-app-id",
    titleId: "your-title-id",
    deviceToken: deviceToken.Token,
    offers: new List<string> { "your-offers" },
    redirectUri: "your-redirect-url"
);

// After user authorization, request SISU tokens
var sisuTokens = await authClient.RequestSISUTokens(
    deviceToken: deviceToken.Token,
    accessToken: "access-token-from-oauth",
    appId: "your-app-id",
    sessionId: sisuSession.SessionId
);

Error Handling

All authentication methods return null when they fail. Always check for null before using the result:

var oauthToken = await authClient.RequestOAuthToken(clientId, code, redirectUrl);
if (oauthToken == null)
{
    // Handle authentication failure
    Console.WriteLine("Failed to obtain OAuth token");
    return;
}

var userToken = await authClient.RequestUserToken(oauthToken.AccessToken);
if (userToken == null)
{
    // Handle user token failure
    Console.WriteLine("Failed to obtain user token");
    return;
}

// Check token expiration before use
if (oauthToken.ExpiresIn <= 0)
{
    // Token may be expired, refresh it
    oauthToken = await authClient.RefreshOAuthToken(
        clientId,
        oauthToken.RefreshToken,
        redirectUrl
    );
}

Contributing

See CONTRIBUTING.md for guidelines on how to contribute to this project.

License

This project is licensed under the MIT License. See the LICENSE file for details.

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 (1)

Showing the top 1 NuGet packages that depend on Den.Dev.Conch:

Package Downloads
Den.Dev.Grunt

An unofficial wrapper for the Halo APIs. Currently supports the full API stack for Halo Infinite.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.2 104 1/24/2026
0.0.1 37 1/24/2026

Initial release of the Den.Dev.Conch package.