CoreStone.SDK.Dotnet.Auth 1.5.0

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

CoreStone.SDK.Dotnet.Auth

Authentication client for the CoreStone platform — register, login, MFA, token refresh, and logout.

Installation

dotnet add package CoreStone.SDK.Dotnet.Configuration
dotnet add package CoreStone.SDK.Dotnet.Auth

Setup

builder.Services
    .AddCoreStoneConfiguration(o => {
        o.BaseUrl    = "https://api.yourapp.com";
        o.ProjectKey = "prj-xxxxxxxxxxxxxxxx";
    })
    .AddCoreStoneAuth();

Usage

Register

public class RegisterController(IAuthClient auth) : Controller
{
    public async Task<IActionResult> Register(RegisterRequest request)
    {
        var result = await auth.RegisterAsync(new RegisterRequest
        {
            IdentityType = "email",
            Identifier   = "user@example.com",
            Password     = "SecurePass123!",
            DisplayName  = "John Doe"
        });

        // Tokens are automatically stored — subsequent calls are authenticated
        return Ok(result.User);
    }
}

Login

var result = await auth.LoginAsync(new LoginRequest
{
    IdentityType = "email",
    Identifier   = "user@example.com",
    Password     = "SecurePass123!"
});

if (result.MfaRequired)
{
    // User has 2FA enabled — complete with VerifyTwoFactorAsync
    var verified = await auth.VerifyTwoFactorAsync(new VerifyTwoFactorRequest
    {
        MfaToken = result.MfaToken!,
        Code     = "123456"   // From authenticator app
    });
}

Get Current User

var me = await auth.MeAsync();
Console.WriteLine($"Hello {me.Profile?.DisplayName}");

Logout

await auth.LogoutAsync();
// Tokens are automatically cleared

Automatic Token Refresh

The SDK silently refreshes the access token on 401 responses. You don't need to handle this manually — just catch CoreStoneException with Code == "SESSION_EXPIRED" to redirect to login when the refresh token also expires.

try
{
    var data = await supportClient.ListTicketsAsync();
}
catch (CoreStoneException ex) when (ex.Code == "SESSION_EXPIRED")
{
    // Redirect user to login
}

Supported Identity Types

Value Description
email Email address
phone Phone number
username Username
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  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 (7)

Showing the top 5 NuGet packages that depend on CoreStone.SDK.Dotnet.Auth:

Package Downloads
CoreStone.SDK.Dotnet.Announcement

CoreStone SDK — announcements (fetch active announcements for the app).

CoreStone.SDK.Dotnet.MenuManagement

CoreStone SDK — app menu management (fetch dynamic menus).

CoreStone.SDK.Dotnet.UserManagement

CoreStone SDK — user profile management (get, update, delete account).

CoreStone.SDK.Dotnet.Support

CoreStone SDK — support ticket management (create, list, reply, close).

CoreStone.SDK.Dotnet.Notifications

CoreStone SDK — in-app notification inbox (list, unread count, mark read/unread, mark all read).

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.5.0 256 6/22/2026
1.4.0 226 6/18/2026
1.3.0 215 6/18/2026
1.2.0 199 6/18/2026
1.1.0 208 6/18/2026
1.0.9 191 6/17/2026
1.0.8 188 6/17/2026
1.0.7 199 6/17/2026
1.0.6 187 6/15/2026
1.0.5 185 6/15/2026