NuvTools.Account.Client.Blazor 10.0.1

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

NuvTools.Account.Client.Blazor

Browser side of signing in through Nuv Tools Account, for a product's Blazor WebAssembly app: the authorization code flow with PKCE as a public client, the callback that redeems the code, and signing out through the Account's end-session page.

The Account's access token is handed to the product once, on the callback — typically to exchange it at the product's API for the product's own session (see NuvTools.Account.Client.AspNetCore). No refresh token is asked of the Account.

Registering

builder.Services.AddNuvToolsAccountSignIn(options =>
{
    options.Scopes.Add("dataprovider-api");   // the product API's scope, which is also its audience
    options.DefaultReturnPath = "/portal";
});

With Authority and ClientId left empty, they are read from account-settings.json on the app's own host, which MapNuvToolsAccountSettings serves per environment. The client must be registered at the Account with the redirect address {base}authentication/login-callback and the post-sign-out address {base} (both configurable).

Signing in

// The sign-in screen
if (!AccountSignIn.SigningOut)
    await AccountSignIn.StartAsync(returnUrl);

// The page at /authentication/login-callback
var completed = await AccountSignIn.CompleteAsync(new Uri(Navigation.Uri),
    accountAccessToken => Authentication.SignInWithAccountAsync(accountAccessToken));

Navigation.NavigateTo(completed.Succeeded ? completed.Data!.ReturnUrl : "/login?failed=true", replace: true);

CompleteAsync runs once per page load: opening a session usually rebuilds the callback page, and the second instance receives the first one's answer. The state is spent on the way in, so the same response cannot be used twice. Return addresses off the app are replaced by DefaultReturnPath.

Organizations

Add the Account's own API to the scopes (options.Scopes.Add("account-api"), and give the client that scope at the Account) to list the person's organizations for a switcher:

var organizations = await AccountSignIn.GetOrganizationsAsync(); // Id, Name, Role
await AccountSignIn.SwitchAsync(organizationId, returnUrl);      // null = personal context

SwitchAsync asks the Account for that organization with prompt=none, so no sign-in page appears while the Account session lasts; the callback completes as for a sign-in, with a token naming the organization and the person's role. GetOrganizationsAsync uses the access token of the last sign-in in the tab and fails once it has expired; a switch or a sign-in brings a new one.

Signing out

var accountSignOut = await AccountSignIn.SignOutAddressAsync(); // read before clearing the session
await Authentication.LogoutAsync();
Navigation.NavigateTo(accountSignOut ?? "/", forceLoad: true);

SignOutAddressAsync sets SigningOut, which a sign-in screen checks so that ending the local session does not start a new sign-in and cancel the trip to the Account. ManageAddressAsync gives the Account's page where the person manages their password, second factors and passkeys.

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 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.

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
10.0.1 37 10/21/2026
10.0.0 46 10/21/2026