Agent skill

Blazor Authentication

by Nethereum in Nethereum/Nethereum

Implement Sign-In with Ethereum (SIWE / EIP-4361) authentication in Blazor with JWT tokens, session management, and AuthorizeView (.NET/C).

MITAuto-check passedBackend & APIs

Install Blazor Authentication

skills CLI
$ npx skills add Nethereum/Nethereum --skill blazor-authentication -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Nethereum/Nethereum blazor-authentication --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Nethereum/Nethereum.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/nethereum-skills/skills/blazor-authentication .claude/skills/blazor-authentication && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
blazor-authentication
GitHub stars
2.3k
Token cost
~1.8k tokens
SKILL.md length
269 words
Files
1
Skills in repo
71
Repo updated
First seen
Licence
MIT

At a glance

Implement Sign-In with Ethereum (SIWE / EIP-4361) authentication in Blazor with JWT tokens, session management, and AuthorizeView (.NET/C).

  • Works in 5 steps: Server creates a SiweMessage with a… → Client signs the message with their wallet → Server verifies signature matches the… → …
  • The user asks about SIWE
  • SKILL.md covers SIWE Flow, Blazor Server (Simplest), Blazor WASM + REST API and Using AuthorizeView, plus 4 more sections
  • Calls dotnet

What it does

Blazor Authentication is an agent skill from Nethereum/Nethereum. Implement Sign-In with Ethereum (SIWE / EIP-4361) authentication in Blazor with JWT tokens, session management, and AuthorizeView (.NET/C). Use this skill when the user asks about SIWE, Sign-In with Ethereum, Blazor authentication with Ethereum wallets, JWT with SIWE, EthereumAuthenticationStateProvider, or wallet-based login.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Authentication. It works with Blazor, Ethereum, C# and .NET. The repository describes itself as: Ethereum .Net cross platform integration library. The licence is MIT.

When your agent uses it

  • The user asks about SIWE
  • Sign-In with Ethereum
  • Blazor authentication with Ethereum wallets
  • EthereumAuthenticationStateProvider

Example prompts

  • “/blazor-authentication”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Server creates a SiweMessage with a random nonce
  2. Client signs the message with their wallet
  3. Server verifies signature matches the claimed address
  4. Server issues a JWT (WASM) or stores session (Server)
  5. Blazor checks claims

What it can do on your machine

Read from SKILL.md and the folder at commit 229f278. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • dotnet

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com
    • docs.nethereum.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Blazor Authentication loads about 1.8k tokens when it runs. Until then it costs about 88 tokens; SKILL.md has 269 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~88
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Nethereum/Nethereum at commit 229f278, republished under its MIT licence (© Nethereum). 269 words, ~1,829 tokens.

Download SKILL.mdSave it as .claude/skills/blazor-authentication/SKILL.md (or your agent's skills folder).
name
blazor-authentication
description
Implement Sign-In with Ethereum (SIWE / EIP-4361) authentication in Blazor with JWT tokens, session management, and AuthorizeView (.NET/C#). Use this skill when the user asks about SIWE, Sign-In with Ethereum, Blazor authentication with Ethereum wallets, JWT with SIWE, EthereumAuthenticationStateProvider, or wallet-based login.
user-invocable
true

SIWE Authentication in Blazor

Implement Sign-In with Ethereum (EIP-4361) authentication in Blazor. Supports Blazor Server (direct signing) and Blazor WASM (REST API + JWT).

NuGet: Nethereum.Siwe, Nethereum.Blazor

A complete starter template is available:

bash
dotnet new install Nethereum.Templates.Pack
dotnet new nethereum-siwe

Template repo: https://github.com/Nethereum/Nethereum.Templates.Pack (templates/Nethereum.Templates.Siwe)

SIWE Flow

  1. Server creates a SiweMessage with a random nonce
  2. Client signs the message with their wallet
  3. Server verifies signature matches the claimed address
  4. Server issues a JWT (WASM) or stores session (Server)
  5. Blazor <AuthorizeView> checks claims

Blazor Server (Simplest)

Everything runs in one process. No REST API needed.

Setup (Program.cs)
csharp
builder.Services.AddSingleton<SiweMessageService>();
builder.Services.AddSingleton<NethereumSiweAuthenticatorService>();
builder.Services.AddScoped<IAccessTokenService, ProtectedSessionStorageAccessTokenService>();
builder.Services.AddScoped<AuthenticationStateProvider, SiweAuthenticationServerStateProvider>();
Authentication Flow

The SiweAuthenticationServerStateProvider orchestrates the full flow:

csharp
public async Task AuthenticateAsync(string address = null)
{
    if (string.IsNullOrEmpty(address))
        address = await EthereumHostProvider.GetProviderSelectedAccountAsync();

    var siweMessage = new DefaultSiweMessage();
    siweMessage.Address = address.ConvertToEthereumChecksumAddress();
    siweMessage.SetExpirationTime(DateTime.UtcNow.AddMinutes(10));
    siweMessage.SetNotBefore(DateTime.UtcNow);

    var fullMessage = await nethereumSiweAuthenticatorService.AuthenticateAsync(siweMessage);
    await _accessTokenService.SetAccessTokenAsync(SiweMessageStringBuilder.BuildMessage(fullMessage));
    await MarkUserAsAuthenticated();
}

The NethereumSiweAuthenticatorService (from Nethereum.UI) handles:

  • Building the message string with nonce
  • Prompting the wallet to sign via IEthereumHostProvider
  • Verifying the signature

Blazor WASM + REST API

REST API: Generate SIWE Message
csharp
[AllowAnonymous]
[HttpPost("newsiwemessage")]
public IActionResult GenerateNewSiweMessage([FromBody] string address)
{
    var message = new DefaultSiweMessage();
    message.SetExpirationTime(DateTime.UtcNow.AddMinutes(10));
    message.SetNotBefore(DateTime.UtcNow);
    message.Address = address.ConvertToEthereumChecksumAddress();
    return Ok(_siweMessageService.BuildMessageToSign(message));
}
REST API: Authenticate and Issue JWT
csharp
[AllowAnonymous]
[HttpPost("authenticate")]
public async Task<IActionResult> Authenticate(AuthenticateRequest request)
{
    var siweMessage = SiweMessageParser.Parse(request.SiweEncodedMessage);

    if (!await _siweMessageService.IsUserAddressRegistered(siweMessage))
        return Unauthorized("Invalid User");

    if (!await _siweMessageService.IsMessageSignatureValid(siweMessage, request.Signature))
        return Unauthorized("Invalid Signature");

    if (!_siweMessageService.IsMessageTheSameAsSessionStored(siweMessage))
        return Unauthorized("Nonce mismatch");

    if (!_siweMessageService.HasMessageDateStartedAndNotExpired(siweMessage))
        return Unauthorized("Expired");

    var token = _siweJwtAuthorisationService.GenerateToken(siweMessage, request.Signature);
    return Ok(new AuthenticateResponse { Address = siweMessage.Address, Jwt = token });
}
WASM Client: Sign and Authenticate
csharp
public async Task AuthenticateAsync(string address)
{
    var siweMessage = await _siweUserLoginService.GenerateNewSiweMessage(address);
    var signedMessage = await EthereumHostProvider.SignMessageAsync(siweMessage);
    var response = await _siweUserLoginService.Authenticate(
        SiweMessageParser.Parse(siweMessage), signedMessage);

    if (response.Jwt != null)
    {
        await _accessTokenService.SetAccessTokenAsync(response.Jwt);
        await MarkUserAsAuthenticated();
    }
}

Using AuthorizeView

Two roles are available:

RoleMeaning
EthereumConnectedWallet is connected (from EthereumAuthenticationStateProvider)
SiweAuthenticatedSIWE signature verified (from SiweAuthentication*StateProvider)
razor
<AuthorizeView Roles="EthereumConnected">
    <Authorized>
        <p>Wallet connected: @context.User.Identity?.Name</p>
        <AuthorizeView Roles="SiweAuthenticated">
            <NotAuthorized>
                <button @onclick="LoginAsync">Sign In</button>
            </NotAuthorized>
        </AuthorizeView>
    </Authorized>
    <NotAuthorized>
        <button @onclick="ConnectWalletAsync">Connect Wallet</button>
    </NotAuthorized>
</AuthorizeView>

<AuthorizeView Roles="SiweAuthenticated">
    <Authorized>
        <p>Authenticated as @context.User.FindFirst(ClaimTypes.NameIdentifier)?.Value</p>
        <MyProtectedComponent />
    </Authorized>
</AuthorizeView>

NFT-Gated Access

Use ERC721BalanceEthereumUserService to require users hold a specific NFT:

csharp
var userService = new ERC721BalanceEthereumUserService(web3, nftContractAddress);
var siweService = new SiweMessageService(
    new InMemorySessionNonceStorage(),
    userService);

IsUserAddressRegistered will check the user's NFT balance before allowing authentication.

Smart Contract Wallets (ERC-1271 / ERC-6492)

Pass a Web3 instance to SiweMessageService for smart contract wallet signature verification:

csharp
var siweService = new SiweMessageService(
    new InMemorySessionNonceStorage(),
    ethereumUserService: null,
    web3ForERC1271Validation: web3);

IsMessageSignatureValid automatically falls back to ERC-1271 on-chain verification, and supports ERC-6492 for counterfactual (not-yet-deployed) smart wallets.

SiweMessageService API

MethodPurpose
BuildMessageToSign(message)Build message string, assign nonce, store in session
IsMessageSignatureValid(message, signature)Verify ECDSA or ERC-1271/ERC-6492 signature
IsValidMessage(message, signature)Full validation: timing + session + signature
IsUserAddressRegistered(message)Check user via IEthereumUserService
HasMessageDateStartedAndNotExpired(message)Check NotBefore and ExpirationTime
IsMessageTheSameAsSessionStored(message)Verify message matches stored nonce
InvalidateSession(message)Remove session (logout)

Claims Structure

csharp
new Claim(ClaimTypes.Name, userName);
new Claim(ClaimTypes.NameIdentifier, ethereumAddress);
new Claim(ClaimTypes.Role, "EthereumConnected");
new Claim(ClaimTypes.Role, "SiweAuthenticated");

For full documentation, see: https://docs.nethereum.com/docs/blazor-dapp-integration/guide-blazor-authentication

© Nethereum, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/nethereum-skills/skills/blazor-authentication of Nethereum/Nethereum.

Open the folder on GitHubat commit 229f278

Compare with similar skills

Blazor Authentication next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Blazor Authentication compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Blazor Authentication this skillNethereum/Nethereum2.3k—~1.8kAutomated safety check: PassMIT
Using Dotnetnovotnyllc/dotnet-artisan233—~2.3kAutomated safety check: WarnMIT
Dotnet Webapidotnet/skills5.6k2 repos~5.5kAutomated safety check: PassMIT
C# and .NET DeveloperJeffallan/claude-skills12k—~1.3kAutomated safety check: PassMIT
.NET Core ExpertJeffallan/claude-skills12k—~1.3kAutomated safety check: PassMIT
Use JS Interopdotnet/skills5.6k1 repos~2.7kAutomated safety check: PassMIT

Similar skills

  • Using Dotnet

    novotnyllc/dotnet-artisan

    Detects .NET intent for any C, ASP.NET Core, EF Core, Blazor, MAUI, Uno Platform, WPF, WinUI, SignalR, gRPC, xUnit, NuGet, or MSBuild request from prompt keywords and repository signals (.sln…

    233 GitHub stars~2.3k tokensUpdated 1 mo ago
    Backend & APIsAuto-check: warnings
  • Dotnet Webapi

    dotnet/skills

    Official

    Guides creation and modification of ASP.NET Core Web API endpoints with correct HTTP semantics, OpenAPI metadata, and error handling.

    5.6k GitHub starsUsed in 2 repos~5.5k tokens
    Backend & APIsAuto-check passed
  • C# and .NET Developer

    Jeffallan/claude-skills

    Guides C# work on .NET 8+: ASP.NET Core APIs, Entity Framework Core data access, Blazor apps and CQRS with MediatR, following a five-step build workflow.

    12k GitHub stars~1.3k tokensUpdated 4 days ago
    Backend & APIsAuto-check passed
  • .NET Core Expert

    Jeffallan/claude-skills

    Guides building .NET 8 services with minimal APIs, clean architecture, Entity Framework Core, MediatR CQRS and JWT authentication, with build and test checks.

    12k GitHub stars~1.3k tokensUpdated 4 days ago
    Backend & APIsAuto-check passed
  • Use JS Interop

    dotnet/skills

    Official

    Add, review, or fix JavaScript interop in Blazor components.

    5.6k GitHub starsUsed in 1 repo~2.7k tokens
    Backend & APIsAuto-check passed
  • Writing Csharp Code

    microsoft-foundry/foundry-agent-webapp

    Provides C and ASP.NET Core coding standards for this repository.

    127 GitHub stars~3.2k tokensUpdated 5 mo ago
    Backend & APIsAuto-check: notes

More from Nethereum/Nethereum

All 71 skills in this repo
  • Aa Batching Paymasters

    Nethereum/Nethereum

    Help users batch multiple calls into a single UserOperation and sponsor gas with paymasters using Nethereum Account Abstraction.

    2.3k GitHub stars~1.5k tokensUpdated 2 days ago
    Auto-check passed
  • Aa Bundler

    Nethereum/Nethereum

    Help users run an ERC-4337 bundler using Nethereum — set up in-process or standalone bundlers with mempool, validation, reputation, and JSON-RPC server.

    2.3k GitHub stars~1.2k tokensUpdated 2 days ago
    Auto-check passed
  • Abi Encoding

    Nethereum/Nethereum

    Encode and decode Ethereum ABI data with Nethereum. An agent skill from Nethereum/Nethereum.

    2.3k GitHub stars~1.3k tokensUpdated 2 days ago
    Auto-check passed
  • Abi Retrieval

    Nethereum/Nethereum

    Fetch contract ABIs from Sourcify, Etherscan, and 4Byte Directory using the composite ABIInfoStorage pattern (.NET/C).

    2.3k GitHub stars~1.5k tokensUpdated 2 days ago
    Auto-check passed
  • Account Abstraction

    Nethereum/Nethereum

    Help users implement ERC-4337 Account Abstraction with Nethereum — send UserOperations, use smart accounts, route contract calls through a bundler, enable gasless transactions, or work with AA in…

    2.3k GitHub stars~1.7k tokensUpdated 2 days ago
    Auto-check passed
  • Address Utils

    Nethereum/Nethereum

    Validate and format Ethereum addresses with Nethereum. An agent skill from Nethereum/Nethereum.

    2.3k GitHub stars~1.2k tokensUpdated 2 days ago
    Auto-check passed

Categories

Questions about Blazor Authentication

What does Blazor Authentication do?

Implement Sign-In with Ethereum (SIWE / EIP-4361) authentication in Blazor with JWT tokens, session management, and AuthorizeView (.NET/C). Blazor Authentication is an agent skill from Nethereum/Nethereum.NET/C).

When should I use Blazor Authentication?

Blazor Authentication fits situations like: the user asks about SIWE; sign-In with Ethereum; blazor authentication with Ethereum wallets; ethereumAuthenticationStateProvider.

How do I install Blazor Authentication in Claude Code?

Run `npx skills add Nethereum/Nethereum --skill blazor-authentication -a claude-code`. Or copy the skill folder (plugins/nethereum-skills/skills/blazor-authentication in Nethereum/Nethereum) into .claude/skills/blazor-authentication in your project. Claude Code loads it when a task matches its description.

How do I install Blazor Authentication in Codex?

Run `npx skills add Nethereum/Nethereum --skill blazor-authentication -a codex`. Or copy the skill folder (plugins/nethereum-skills/skills/blazor-authentication in Nethereum/Nethereum) into .agents/skills/blazor-authentication in your project. Codex loads it when a task matches its description.

Can I use Blazor Authentication in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Nethereum/Nethereum --skill blazor-authentication -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/blazor-authentication, .gemini/skills/blazor-authentication, .github/skills/blazor-authentication and .opencode/skills/blazor-authentication in your project.

What does Blazor Authentication need to run?

Going by SKILL.md and its folder, Blazor Authentication needs the command-line tools its instructions call (dotnet).

Does Blazor Authentication access the network?

SKILL.md names 2 domains. As links in the text: github.com and docs.nethereum.com. This is read from the text; nothing was executed.

Is Blazor Authentication safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Blazor Authentication use?

Blazor Authentication is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Blazor Authentication use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Blazor Authentication?

Skills that share tags, products or a category with Blazor Authentication: Using Dotnet (novotnyllc/dotnet-artisan, 233 stars), Dotnet Webapi (dotnet/skills, 5.6k stars), C# and .NET Developer (Jeffallan/claude-skills, 12k stars) and .NET Core Expert (Jeffallan/claude-skills, 12k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Blazor Authentication?

Nethereum (a GitHub organization) maintains it in Nethereum/Nethereum, which has 2,260 GitHub stars. The repository holds 71 skills in this directory. The repository was last updated on October 5, 2026.

Source: Nethereum/Nethereum on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.