Lyo.Authentication.Sso
3.0.0
dotnet add package Lyo.Authentication.Sso --version 3.0.0
NuGet\Install-Package Lyo.Authentication.Sso -Version 3.0.0
<PackageReference Include="Lyo.Authentication.Sso" Version="3.0.0" />
<PackageVersion Include="Lyo.Authentication.Sso" Version="3.0.0" />
<PackageReference Include="Lyo.Authentication.Sso" />
paket add Lyo.Authentication.Sso --version 3.0.0
#r "nuget: Lyo.Authentication.Sso, 3.0.0"
#:package Lyo.Authentication.Sso@3.0.0
#addin nuget:?package=Lyo.Authentication.Sso&version=3.0.0
#tool nuget:?package=Lyo.Authentication.Sso&version=3.0.0
Lyo.Authentication.Sso
Protocol-neutral SSO host. OpenID Connect and SAML register an ISsoProtocol on SsoProtocolRegistry. This package owns the browser handoff, the /auth/* endpoints, and the user
link plus JWT mint. It does not speak either protocol.
Examples
Map the endpoints
using Lyo.Authentication.Sso.Endpoints;
services.AddLyoSso(builder.Configuration);
services.AddLyoOpenIdConnect();
app.MapLyoAuthEndpoints();
LyoSso
{
"LyoSso": {
"AllowedReturnOrigins": [ "https://app.example.com" ],
"DefaultReturnUrl": "/",
"HandoffCodeTtl": "00:00:30"
},
"LyoExternalLogin": {
"Policy": "JustInTime",
"RequireVerifiedEmail": true
}
}
Endpoints
GET /auth/login/{provider}starts the protocol registered for that name. A non-emptyreturnUrlthat failsIsAllowedReturnUrlis 400InvalidRequestbeforeStartAsync. The error namesLyoSso:AllowedReturnOrigins.GET /auth/callback/{provider}is the OpenID Connect path. The state cookie islyo_oidc_state(HttpOnly, essential, SameSite=Lax, 15 minutes). It is set only when the protocol returns a sealed value.POST /auth/callback/{provider}is the SAML HTTP-POST path. It callsDisableAntiforgery. The form fields areSAMLResponseandRelayState. A GET to a SAML provider, or a POST to an OpenID Connect provider, is rejected before the body is read.POST /auth/handoff/exchangeconsumes thelyo_handoffcode.IssuedTois the origin of the return URL stored at login start, or the API origin when that URL is relative. The callback request origin is neverIssuedTo.mode=apireturns token JSON and writes no handoff code. That branch is for OpenID Connect. SAML completion always uses the browser handoff.
Options
AddLyoSso(IConfiguration) binds LyoExternalLogin and LyoSso. AddLyoOpenIdConnect(IConfiguration) does not bind these options itself.
Completion
IExternalLoginCompletion links the provider subject and mints one Lyo JWT. Provider scopes are stored on the link and are not copied onto the JWT. JitFromAllowedClaim matches a
string or any entry of an IReadOnlyList<string>. A rejected login is 401, writes no handoff, and does not redirect to the return URL.
Dependencies
Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).
Lyo.Api.Models(direct, lyo)Lyo.Authentication(direct, lyo)Lyo.Common.Core(direct, lyo)Lyo.Exceptions(direct, lyo)Lyo.Authentication.Models(transitive, lyo)Lyo.Common.Metadata(transitive, lyo)Lyo.DataTable.Models(transitive, lyo)Lyo.DateAndTime(transitive, lyo)Lyo.Hashing(transitive, lyo)Lyo.Json(transitive, lyo)Lyo.KeyStore(transitive, lyo)Lyo.Parameters(transitive, lyo)Lyo.Query.Models(transitive, lyo)Lyo.Result(transitive, lyo)BouncyCastle.Cryptography2.6.2(transitive, third-party)Konscious.Security.Cryptography.Argon21.3.1(transitive, third-party)Microsoft.Bcl.AsyncInterfaces10.0.5(transitive, microsoft, netstandard2.0)Microsoft.Extensions.Configuration.Binder10.0.5(transitive, microsoft)Microsoft.Extensions.DependencyInjection.Abstractions10.0.5(transitive, microsoft, net10.0, netstandard2.0)Microsoft.Extensions.Hosting.Abstractions10.0.5(transitive, microsoft)Microsoft.Extensions.Options10.0.5(transitive, microsoft)System.IO.Hashing10.0.5(transitive, microsoft, net10.0)System.Memory4.6.3(transitive, microsoft, netstandard2.0)System.Text.Encoding.CodePages10.0.5(transitive, microsoft)System.Text.Json10.0.5(transitive, microsoft, netstandard2.0)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Lyo.Api.Models (>= 3.0.0)
- Lyo.Authentication (>= 3.0.0)
- Lyo.Common.Core (>= 3.0.0)
- Lyo.Exceptions (>= 3.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Lyo.Authentication.Sso:
| Package | Downloads |
|---|---|
|
Lyo.Authentication.OpenIdConnect
OpenID Connect client base for Lyo.Authentication. Implements the BFF login flow used by Google and Keycloak adapters: OIDC discovery, JWKS cache, PKCE/state/nonce generation, /token exchange, id_token validation, and the external-login coordinator that maps an external login to a Lyo user + linked identity and mints a Lyo JWT. |
|
|
Lyo.Authentication.Saml
SAML 2.0 service provider for Lyo.Authentication.Sso. SP-initiated HTTP-Redirect login and HTTP-POST assertion consumption. Unsigned AuthnRequests. Encrypted assertions are rejected. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0 | 78 | 10/23/2026 |