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
<PackageReference Include="Epsitec.Passport.Shared" Version="5.7.5.2649" />
<PackageVersion Include="Epsitec.Passport.Shared" Version="5.7.5.2649" />
<PackageReference Include="Epsitec.Passport.Shared" />
paket add Epsitec.Passport.Shared --version 5.7.5.2649
#r "nuget: Epsitec.Passport.Shared, 5.7.5.2649"
#:package Epsitec.Passport.Shared@5.7.5.2649
#addin nuget:?package=Epsitec.Passport.Shared&version=5.7.5.2649
#tool nuget:?package=Epsitec.Passport.Shared&version=5.7.5.2649
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 (
PassportContainerand its panels), their state (AppState), and their localization resources (French and German.pofiles). 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, throughIPassportLoginClientand its implementationPassportLoginClient.- 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), andMfaRecoveryConfirmPanel(the warning before a regeneration, reached by the button#generate-recovery-codesof the user-information panel).MfaSetupDonePanelstays but is no longer navigated to: the codes panel follows an activation. LoginFlowLogicgains the abstractVerifyRecoveryCode,GenerateRecoveryCodes,ContinueAfterSecondFactor,ContinueAfterRecoveryCodes, andStartRecoveryCodesRegeneration, implemented byNativeLoginFlowLogic.IPassportLoginClientgains anOpenoverload with astep(recovery-codesfor a regeneration) andMfaRecoveryVerify,RecoveryCodes, andRecoveryDone; an implementation of the interface outside this package must add them.AppStategainsRecoveryCodes,RecoveryCodesFlow,RecoveryRegeneration,RecoveryCodeCount,OffersRecoveryCodes,SecondFactorEnrolled,CanRegenerateRecoveryCodes,MfaVerifiedAccessToken, and the methods that set and clear them.LoginPanelTypegainsMfaRecovery,MfaRecoveryCodes,MfaRecoveryOffer, andMfaRecoveryConfirm;ErrorStategainsMfaWrongRecoveryCodeandMfaRecoveryCodesFailed;InputFieldClassgainsRecoveryCode: all appended last.- Host-styling contract change. A host styles
MfaRecoveryCodesPanelwith the selectors#recovery-codes-warning(the warning callout, with its icon and its textspan),#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 keepp.warning,input#recovery-code,p.hint,ol#recovery-steps, andbutton#generate-recovery-codes.- Each
liofol#recovery-codesholds fourspanelements, 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-headis gone, and the list no longer holds one bare code perli: a host that styled them must update its style sheet.
- Each
Breaking changes of version 5
LoginFlowLogicis abstract, with the single constructorLoginFlowLogic (AppState state); its server-facing operations (GetClientSaltAndParameters,AuthenticateOneFa,ShowMfaPanels, the MFA methods,ExecuteLogin,CancelLogin,RefreshPersonaList,CreateNewPersona, …) are abstract. Derive fromNativeLoginFlowLogicinstead ofLoginFlowLogic.- Removed from
LoginFlowLogic: the five clients ofauthandmailer(AuthClient,AuthMfaClient,AuthRegistrationClient,AuthResetClient,MailValidatorClient) andPersonaDecorators, as constructor parameters and fields, and the membersGetDecorator,AddPersona,AddPersonaToProvenSubject,SelectCandidates,GetAllPersonaeFromAuthBasedOnState,GetProvenSubject,GetUserClaims,GetUserPersonaId,GetUserCommonClaims,AdoptTokenLogin, andReadSecondFactorSubject. - Removed types:
IScopedPersonaDecorator,PersonaDecorators,CompositeScopedPersonaDecorator,UpgradePersonaResult,UserInformationRule,UserInformationDecision, andLoginPersona.CreateList. GetClientSaltAndParametersreturns the package'sHashParametersinstead of auth'sClientSaltAndHashParameters;CreateNewPersonareturns the new persona id (Task<int>); the newGetRegistrationHashParametersgives the parameters a registration hash must use.SaveUserInformationis no longer virtual: it checks the communication address, then calls the new protected primitiveSaveUserInformationOnServer.RegisterStart,ResetStart, and the mail check likewise callRegisterStartOnServer,ResetStartOnServer, andIsMailValidOnServer.LoginPersona.DisableMessagesis anImmutableList<string>instead of a list ofLocalizedString.AppState.GetTotpUri ()is replaced by the propertyAppState.TotpUri, which the logic sets with the secret.ErrorStategainsTooManyAttemptsandFlowExpired, 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.AppStategainsRetryAfterUntil,RetryAfterSeconds,IsRateLimited, andSetRetryAfter.StatusIndicatorgains theRateLimitOnlyparameter, which shows only these two refusals (the MFA panels use it).AddPassportSharedServiceskeeps its signature but no longer registersAuthTokenCache, the clients ofauthandmailer, orPersonaDecorators; it registersIPassportLoginClientand the"Passport"named client, and needsservices:passport:urlinstead ofservices:auth:urlandservices:mailer:url.
This package is intended for applications that want to integrate Passport authentication into a Blazor solution.
| Product | Versions 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. |
-
net10.0
- BouncyCastle.Cryptography (>= 2.7.0)
- Epsitec.Bcx.Core (>= 7.4.5.2641)
- Epsitec.Rezo.Api (>= 11.18.1.2649)
- Konscious.Security.Cryptography.Argon2 (>= 1.3.1)
- Microsoft.AspNetCore.Components (>= 10.0.15)
- Microsoft.AspNetCore.Components.Forms (>= 10.0.15)
- Microsoft.AspNetCore.Components.Web (>= 10.0.15)
- Microsoft.AspNetCore.Http.Connections.Client (>= 10.0.15)
- Microsoft.AspNetCore.Http.Connections.Common (>= 10.0.15)
- Microsoft.AspNetCore.Mvc.NewtonsoftJson (>= 10.0.15)
- Microsoft.AspNetCore.SignalR.Client (>= 10.0.15)
- Microsoft.AspNetCore.SignalR.Protocols.Json (>= 10.0.15)
- Microsoft.Bcl.AsyncInterfaces (>= 11.0.0)
- Microsoft.Extensions.Configuration (>= 10.0.15)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.15)
- Microsoft.Extensions.DependencyInjection (>= 10.0.15)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Http (>= 10.0.15)
- Microsoft.Extensions.Localization (>= 10.0.15)
- Microsoft.Extensions.Localization.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Logging (>= 10.0.15)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Options (>= 10.0.15)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.15)
- Microsoft.IdentityModel.Tokens (>= 8.23.0)
- Microsoft.JSInterop (>= 10.0.15)
- Newtonsoft.Json (>= 13.0.4)
- OrchardCore.Localization.Core (>= 3.0.1)
- QrCoder (>= 1.8.1)
- System.Drawing.Common (>= 11.0.0)
- System.Interactive (>= 7.0.1)
- System.Reactive (>= 7.0.0)
-
net11.0
- BouncyCastle.Cryptography (>= 2.7.0)
- Epsitec.Bcx.Core (>= 7.4.5.2641)
- Epsitec.Rezo.Api (>= 11.18.1.2649)
- Konscious.Security.Cryptography.Argon2 (>= 1.3.1)
- Microsoft.AspNetCore.Components (>= 11.0.0)
- Microsoft.AspNetCore.Components.Forms (>= 11.0.0)
- Microsoft.AspNetCore.Components.Web (>= 11.0.0)
- Microsoft.AspNetCore.Http.Connections.Client (>= 11.0.0)
- Microsoft.AspNetCore.Http.Connections.Common (>= 11.0.0)
- Microsoft.AspNetCore.Mvc.NewtonsoftJson (>= 11.0.0)
- Microsoft.AspNetCore.SignalR.Client (>= 11.0.0)
- Microsoft.AspNetCore.SignalR.Protocols.Json (>= 11.0.0)
- Microsoft.Bcl.AsyncInterfaces (>= 11.0.0)
- Microsoft.Extensions.Configuration (>= 11.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 11.0.0)
- Microsoft.Extensions.DependencyInjection (>= 11.0.0)
- Microsoft.Extensions.Http (>= 11.0.0)
- Microsoft.Extensions.Localization (>= 11.0.0)
- Microsoft.Extensions.Localization.Abstractions (>= 11.0.0)
- Microsoft.Extensions.Logging (>= 11.0.0)
- Microsoft.Extensions.ObjectPool (>= 11.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 11.0.0)
- Microsoft.IdentityModel.Tokens (>= 8.23.0)
- Microsoft.JSInterop (>= 11.0.0)
- Newtonsoft.Json (>= 13.0.4)
- OrchardCore.Localization.Core (>= 3.0.1)
- QrCoder (>= 1.8.1)
- System.Drawing.Common (>= 11.0.0)
- System.Interactive (>= 7.0.1)
- System.Reactive (>= 7.0.0)
-
net8.0
- BouncyCastle.Cryptography (>= 2.7.0)
- Epsitec.Bcx.Core (>= 7.4.5.2641)
- Epsitec.Rezo.Api (>= 11.18.1.2649)
- Konscious.Security.Cryptography.Argon2 (>= 1.3.1)
- Microsoft.AspNetCore.Components (>= 8.0.34)
- Microsoft.AspNetCore.Components.Forms (>= 8.0.34)
- Microsoft.AspNetCore.Components.Web (>= 8.0.34)
- Microsoft.AspNetCore.Http.Connections.Client (>= 8.0.34)
- Microsoft.AspNetCore.Http.Connections.Common (>= 8.0.34)
- Microsoft.AspNetCore.Mvc.NewtonsoftJson (>= 8.0.34)
- Microsoft.AspNetCore.SignalR.Client (>= 8.0.34)
- Microsoft.AspNetCore.SignalR.Protocols.Json (>= 8.0.34)
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.15)
- Microsoft.Extensions.Configuration (>= 10.0.15)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.15)
- Microsoft.Extensions.DependencyInjection (>= 10.0.15)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Http (>= 10.0.15)
- Microsoft.Extensions.Localization (>= 9.0.23)
- Microsoft.Extensions.Localization.Abstractions (>= 9.0.23)
- Microsoft.Extensions.Logging (>= 10.0.15)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Options (>= 10.0.15)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.15)
- Microsoft.IdentityModel.Tokens (>= 8.23.0)
- Microsoft.JSInterop (>= 8.0.34)
- Newtonsoft.Json (>= 13.0.4)
- OrchardCore.Localization.Core (>= 2.2.1)
- QrCoder (>= 1.8.1)
- System.Collections.Immutable (>= 10.0.15)
- System.Drawing.Common (>= 10.0.15)
- System.Formats.Asn1 (>= 10.0.15)
- System.Interactive (>= 7.0.1)
- System.IO.Pipelines (>= 10.0.15)
- System.Reactive (>= 7.0.0)
- System.Text.Encodings.Web (>= 10.0.15)
- System.Text.Json (>= 10.0.15)
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 |