Epsitec.Passport.Shared 5.7.5.2649

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

Passport.Shared

Epsitec.Passport.Shared is a .NET library for shared Passport authentication and UI building blocks used by Blazor-based applications: the login panels and their state, and the client of passport's native login API, which the panels run on.

Target framework: .NET 10 / C# 14.

What this package provides

  • The login panels (PassportContainer and its panels), their state (AppState), and their localization resources (French and German .po files).
  • LoginFlowLogic, the abstract orchestration of the panels: field validation, panel sequences, and mail checks; the operations that talk to a server are abstract.
  • NativeLoginFlowLogic, the implementation of these operations over passport's native login API, through IPassportLoginClient and its implementation PassportLoginClient.
  • The records of the native API (Epsitec.Passport.Shared.Api), shared with the passport server.

The package no longer reaches auth or mailer: it references neither Epsitec.Auth.Client nor Epsitec.Mailer.Client. Passport calls them on the client's behalf, with its own keys. The model value types (UserPersonaId, ResourceScope, ClientSecret) still come from Epsitec.Rezo.Api.

Getting started

Derive your login logic from NativeLoginFlowLogic and override OnLoginCompleted, which receives what a completed flow delivers (the tokens of the chosen persona, or the persona id alone for a flow opened on a bearer without the second factor and without the password):

public sealed class YourLoginFlowLogic : NativeLoginFlowLogic
{
    public YourLoginFlowLogic(AppState state, IPassportLoginClient client)
        : base (state, client)
    {
    }

    protected override Task OnLoginCompleted(ApiFlowResult result)
    {
        //  Store result.AccessToken and result.RefreshToken...
        return Task.CompletedTask;
    }
}

Register the shared services and enable the translator middleware in your application startup:

using Epsitec.Net.Localization;
using Epsitec.Passport.Shared.Models;

builder.Services.AddPassportSharedServices<YourApp, YourLoginFlowLogic>(builder.Configuration);

app.UseTranslator();

AddPassportSharedServices registers PassportLoginClient as IPassportLoginClient, over the named HttpClient "Passport" (PassportLoginClient.HttpClientName), which the application may configure further with AddHttpClient ("Passport"). The client reads the base address of the API from the configuration key services:passport:url:

{
  "services": {
    "passport": {
      "url": "https://host/passport/v1/"
    }
  }
}

Passport Container in a Blazor component:

@using Epsitec.Passport.Shared.Components.Panels

<PassportContainer />

A logic opens a flow on the bearer of a logged-in user (persona switch, user-information edit, second-factor step-up) with NativeLoginFlowLogic.OpenOnBearer (accessToken, step, mfa).

OpenOnBearer may show the login panel first, with the login filled in, when the server requires the password of a persona with the education role or a lax refresh token (PassportLoginClient opts in with "relogin": true). The panels send the password on the same flow, then show the personae; the flow ends with tokens, which OnLoginCompleted receives. NativeLoginFlowLogic.IsRelogin is true during such a flow, so that a host overriding GetClientSaltAndParameters reads it after the base call to tell a relogin from a login. The login stays editable: an edited login replaces the flow by a login flow for that account, and IsRelogin turns false.

Recovery codes

The panels handle the single-use recovery codes of the second factor; PassportLoginClient opts in to their steps ("recovery": true) at every opening, and the server decides when they come.

  • New panels, rendered by PassportContainer: MfaRecoveryPanel (a recovery code in place of a code of the app, reached by the footer link of the verification panel), MfaRecoveryCodesPanel (the ten codes, once, with a copy button), MfaRecoveryOfferPanel (the offer at login for an account without codes), and MfaRecoveryConfirmPanel (the warning before a regeneration, reached by the button #generate-recovery-codes of the user-information panel). MfaSetupDonePanel stays but is no longer navigated to: the codes panel follows an activation.
  • LoginFlowLogic gains the abstract VerifyRecoveryCode, GenerateRecoveryCodes, ContinueAfterSecondFactor, ContinueAfterRecoveryCodes, and StartRecoveryCodesRegeneration, implemented by NativeLoginFlowLogic.
  • IPassportLoginClient gains an Open overload with a step (recovery-codes for a regeneration) and MfaRecoveryVerify, RecoveryCodes, and RecoveryDone; an implementation of the interface outside this package must add them.
  • AppState gains RecoveryCodes, RecoveryCodesFlow, RecoveryRegeneration, RecoveryCodeCount, OffersRecoveryCodes, SecondFactorEnrolled, CanRegenerateRecoveryCodes, MfaVerifiedAccessToken, and the methods that set and clear them. LoginPanelType gains MfaRecovery, MfaRecoveryCodes, MfaRecoveryOffer, and MfaRecoveryConfirm; ErrorState gains MfaWrongRecoveryCode and MfaRecoveryCodesFailed; InputFieldClass gains RecoveryCode: all appended last.
  • Host-styling contract change. A host styles MfaRecoveryCodesPanel with the selectors #recovery-codes-warning (the warning callout, with its icon and its text span), #recovery-codes-block, #recovery-codes-block .codes, .codes-head, #recovery-codes-label, .copy-button, ol#recovery-codes, #recovery-codes-hint, #recovery-saved-label, and #recovery-saved; the other recovery panels keep p.warning, input#recovery-code, p.hint, ol#recovery-steps, and button#generate-recovery-codes.
    • Each li of ol#recovery-codes holds four span elements, the code in groups of four characters, with no text between them; the markup carries no number, so the host draws the numbers from a CSS counter and lays out the columns itself.
    • p.field-head is gone, and the list no longer holds one bare code per li: a host that styled them must update its style sheet.

Breaking changes of version 5

  • LoginFlowLogic is abstract, with the single constructor LoginFlowLogic (AppState state); its server-facing operations (GetClientSaltAndParameters, AuthenticateOneFa, ShowMfaPanels, the MFA methods, ExecuteLogin, CancelLogin, RefreshPersonaList, CreateNewPersona, …) are abstract. Derive from NativeLoginFlowLogic instead of LoginFlowLogic.
  • Removed from LoginFlowLogic: the five clients of auth and mailer (AuthClient, AuthMfaClient, AuthRegistrationClient, AuthResetClient, MailValidatorClient) and PersonaDecorators, as constructor parameters and fields, and the members GetDecorator, AddPersona, AddPersonaToProvenSubject, SelectCandidates, GetAllPersonaeFromAuthBasedOnState, GetProvenSubject, GetUserClaims, GetUserPersonaId, GetUserCommonClaims, AdoptTokenLogin, and ReadSecondFactorSubject.
  • Removed types: IScopedPersonaDecorator, PersonaDecorators, CompositeScopedPersonaDecorator, UpgradePersonaResult, UserInformationRule, UserInformationDecision, and LoginPersona.CreateList.
  • GetClientSaltAndParameters returns the package's HashParameters instead of auth's ClientSaltAndHashParameters; CreateNewPersona returns the new persona id (Task<int>); the new GetRegistrationHashParameters gives the parameters a registration hash must use.
  • SaveUserInformation is no longer virtual: it checks the communication address, then calls the new protected primitive SaveUserInformationOnServer. RegisterStart, ResetStart, and the mail check likewise call RegisterStartOnServer, ResetStartOnServer, and IsMailValidOnServer.
  • LoginPersona.DisableMessages is an ImmutableList<string> instead of a list of LocalizedString.
  • AppState.GetTotpUri () is replaced by the property AppState.TotpUri, which the logic sets with the secret.
  • ErrorState gains TooManyAttempts and FlowExpired, appended last: a rate limit (429) shows "Trop de tentatives, réessayez dans n secondes." with a countdown and the button disabled, an expired flow (410) shows "Votre connexion a expiré, veuillez recommencer." on the login panel. AppState gains RetryAfterUntil, RetryAfterSeconds, IsRateLimited, and SetRetryAfter.
  • StatusIndicator gains the RateLimitOnly parameter, which shows only these two refusals (the MFA panels use it).
  • AddPassportSharedServices keeps its signature but no longer registers AuthTokenCache, the clients of auth and mailer, or PersonaDecorators; it registers IPassportLoginClient and the "Passport" named client, and needs services:passport:url instead of services:auth:url and services:mailer:url.

This package is intended for applications that want to integrate Passport authentication into a Blazor solution.

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 was computed.  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.  net11.0 is compatible. 
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
5.7.5.2649 67 12/2/2026
5.7.4.2649 70 12/1/2026
5.7.3.2649 53 12/1/2026
5.7.1.2648 127 11/28/2026
5.6.0.2647 201 11/20/2026
5.4.2.2647 102 11/20/2026
5.3.0.2647 140 11/18/2026
5.2.1.2644 239 10/30/2026
5.2.0.2644 72 10/30/2026
5.1.2.2644 154 10/27/2026
5.0.0.2643 163 10/25/2026
4.1.3.2643 149 10/21/2026
4.1.2.2643 119 10/21/2026
4.0.1.2643 113 10/20/2026
3.51.1.2642 162 10/18/2026
3.46.4.2634 742 8/21/2026
3.46.3.2633 180 8/14/2026
3.46.2.2630 162 7/22/2026
3.46.1.2630 135 7/21/2026
3.44.3.2625 152 6/25/2026