Rystem.Authentication.Social.Blazor
10.0.7
dotnet add package Rystem.Authentication.Social.Blazor --version 10.0.7
NuGet\Install-Package Rystem.Authentication.Social.Blazor -Version 10.0.7
<PackageReference Include="Rystem.Authentication.Social.Blazor" Version="10.0.7" />
<PackageVersion Include="Rystem.Authentication.Social.Blazor" Version="10.0.7" />
<PackageReference Include="Rystem.Authentication.Social.Blazor" />
paket add Rystem.Authentication.Social.Blazor --version 10.0.7
#r "nuget: Rystem.Authentication.Social.Blazor, 10.0.7"
#:package Rystem.Authentication.Social.Blazor@10.0.7
#addin nuget:?package=Rystem.Authentication.Social.Blazor&version=10.0.7
#tool nuget:?package=Rystem.Authentication.Social.Blazor&version=10.0.7
Rystem.Authentication.Social.Blazor
Rystem.Authentication.Social.Blazor is the Blazor-side companion to Rystem.Authentication.Social.
It handles browser-local state, callback processing, token retrieval, user loading, and a small amount of localization glue. It does not replace your server package and it does not register arbitrary social-login providers by itself.
Installation
dotnet add package Rystem.Authentication.Social.Blazor
Architecture
The Blazor package is centered around:
AddSocialLoginUI(...)UseSocialLoginAuthorization()SocialLoginManager- UI components like
SocialAuthenticationandSocialAuthenticationRouter
The normal flow is:
- register the Blazor package with the API base URL and provider client ids
- include the package JavaScript asset in the host page
- wrap the app or route tree in
SocialAuthenticationorSocialAuthenticationRouter - let
SocialLoginManagerread stored state, process the OAuth callback, exchange codes with the server, and load the authenticated user
Registration
The real setup API is:
builder.Services.AddSocialLoginUI(settings =>
{
settings.ApiUrl = "https://localhost:7017";
settings.Google.ClientId = builder.Configuration["SocialLogin:Google:ClientId"];
settings.Microsoft.ClientId = builder.Configuration["SocialLogin:Microsoft:ClientId"];
settings.Platform.RedirectPath = "/account/login";
});
AddSocialLoginUI(...) currently registers:
- singleton
SocialLoginAppSettings - scoped
SocialLoginLocalStorageService - named
HttpClientforSocialLoginManager - transient
SocialLoginManager - singleton
LocalizationMiddleware - scoped
IAuthorizationHeaderProviderviaSocialLoginAuthorizationHeaderProvider
Middleware
app.UseSocialLoginAuthorization();
In the current implementation this only adds the localization middleware. It does not set up authentication middleware or map social-login endpoints.
Required host-page script
The package needs its JS asset loaded explicitly. The sample app does this in src/Authentication/Tests/RystemAuthentication.Social.TestBlazorApp/Components/App.razor:
<script src="_content/Rystem.Authentication.Social.Blazor/socialauthentications.js"></script>
Without that script, local storage helpers and language cookie helpers will not work.
Configuration model
SocialLoginAppSettings currently exposes:
ApiUrlGoogleFacebookMicrosoftPlatformLoginMode
Important runtime note: the built-in <SocialLogin> component currently renders only Microsoft and Google buttons, even though SocialLoginAppSettings also exposes Facebook.
Another important detail: the current runtime flow is effectively driven by Platform.LoginMode; the top-level LoginMode property exists on the settings type but is not the part the runtime actively reads during callback handling.
Platform behavior
Platform.RedirectPath is interpreted like this by SocialLoginManager.GetFullRedirectUri():
- full URI if it contains
:// - web-relative path if it starts with
/ - default to
/account/loginunder the current base URI when omitted
Platform.LoginMode exists, but popup support is not meaningfully implemented in this Blazor package. In practice the flow is redirect-oriented.
Components
SocialAuthentication<TUser>
SocialAuthentication<TUser> wraps authenticated content.
- when no user is loaded, it renders
<SocialLogin>plus optionalLoginPage - when a user is loaded, it cascades
SocialUserandLogoutCallback - if the user implements
ILocalizedSocialUser, it persists the language locally
Sample usage from src/Authentication/Tests/RystemAuthentication.Social.TestBlazorApp/Components/Routes.razor:
<SocialAuthenticationRouter AppAssembly="typeof(Program).Assembly"
DefaultLayout="typeof(Layout.MainLayout)"
TUser="SocialUser"
SetUser="SetUserAsync">
<LoginPage>
<h1>Your customization here.</h1>
</LoginPage>
</SocialAuthenticationRouter>
SocialAuthenticationRouter<TUser>
This is a wrapper around Blazor's router that nests every route inside SocialAuthentication<TUser>.
Use it when you want route-level protection with the package's built-in login shell.
SocialLogin
SocialLogin renders the built-in login buttons above optional child content.
Current built-in button support:
- Microsoft
SocialLogout
SocialLogout renders a logout button and participates in the package's local state cleanup flow.
SocialLoginManager
SocialLoginManager is the imperative entry point.
Key methods:
FetchTokenAsync()MeAsync<TUser>()LogoutAsync()GetFullRedirectUri()
Token resolution flow
FetchTokenAsync() currently does this:
- tries local storage token first
- if expired, tries refresh through
/api/Authentication/Social/Token?provider=DotNet&code=<refreshToken> - if no token, reads
codeandstatefrom the current URI - validates the stored local state
- exchanges the callback code with the server
The callback exchange includes:
Originbased on the current base URIredirectPathfrom the current page path- optional request body containing
code_verifier
User loading flow
MeAsync<TUser>() calls /api/Authentication/Social/User with the bearer token. If that call returns 401, it attempts a DotNet refresh first and retries.
When user loading succeeds, SocialLoginAuthorizationHeaderProvider is updated with the current bearer token so other consumers can read it.
Localization behavior
If the loaded user implements ILocalizedSocialUser, the package:
- stores the language through the JS helper
- writes the
langcookie - updates
CultureInfo.CurrentCultureandCultureInfo.CurrentUICulture
UseSocialLoginAuthorization() then applies that cookie through LocalizationMiddleware on later requests.
Important caveats
This package depends on the server package
It expects a backend that exposes:
/api/Authentication/Social/Token/api/Authentication/Social/User
Without Rystem.Authentication.Social on the server side, the Blazor flow cannot complete.
The built-in UI is narrower than the config surface
The settings type exposes Facebook, but the built-in <SocialLogin> component currently renders only Microsoft and Google buttons.
PKCE support is effectively Microsoft-specific today
The current callback implementation looks for microsoft_code_verifier in local storage when building the token exchange request.
UseSocialLoginAuthorization() is only localization middleware
Despite its name, it does not configure auth handlers or attach bearer tokens to your API clients by itself.
If you want repository/API client calls to reuse the stored social token, you need a separate integration layer. The sample app does that with AddDefaultSocialLoginAuthorizationInterceptorForApiHttpClient() from RepositoryFramework.Api.Client.Authentication.BlazorServer in src/Authentication/Tests/RystemAuthentication.Social.TestBlazorApp/Program.cs.
Logout cleanup is split across manager and component code
SocialLoginManager.LogoutAsync() clears token storage and the in-memory authorization header, while SocialAuthentication also clears state and optionally forces a page reload.
Grounded by sample and source files
src/Authentication/Tests/RystemAuthentication.Social.TestBlazorApp/Program.cssrc/Authentication/Tests/RystemAuthentication.Social.TestBlazorApp/Components/App.razorsrc/Authentication/Tests/RystemAuthentication.Social.TestBlazorApp/Components/Routes.razorsrc/Authentication/Rystem.Authentication.Social.Blazor/Services/SocialLoginManager.cssrc/Authentication/Rystem.Authentication.Social.Blazor/Components/SocialAuthentication.razorsrc/Authentication/Rystem.Authentication.Social.Blazor/Components/SocialAuthenticationRouter.razor
Use this package when you want a Blazor UI and local-session wrapper around the server-side social-login endpoints, not when you need a fully standalone auth system.
| 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
- Microsoft.Identity.Abstractions (>= 11.2.0)
- Rystem (>= 10.0.6)
- Rystem.Authentication.Social.Abstractions (>= 10.0.7)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Rystem.Authentication.Social.Blazor:
| Package | Downloads |
|---|---|
|
Rystem.Api.Client.Authentication.BlazorServer
Rystem.Api helps you to integrate Api Server and Automated Client for Aspect-Oriented programming. |
|
|
Rystem.RepositoryFramework.Api.Client.Authentication.BlazorServer
Rystem.RepositoryFramework allows you to use correctly concepts like repository pattern, CQRS and DDD. You have interfaces for your domains, auto-generated api, auto-generated HttpClient to simplify connection "api to front-end", a functionality for auto-population in memory of your models, a functionality to simulate exceptions and waiting time from external sources to improve your implementation/business test and load test. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.7 | 57 | 3/26/2026 |
| 10.0.6 | 151,692 | 3/3/2026 |
| 10.0.5 | 176 | 2/22/2026 |
| 10.0.4 | 194 | 2/9/2026 |
| 10.0.3 | 147,945 | 1/28/2026 |
| 10.0.1 | 209,112 | 11/12/2025 |
| 9.1.3 | 327 | 9/2/2025 |
| 9.1.2 | 764,541 | 5/29/2025 |
| 9.1.1 | 97,868 | 5/2/2025 |
| 9.0.32 | 186,714 | 4/15/2025 |
| 9.0.31 | 5,862 | 4/2/2025 |
| 9.0.30 | 88,852 | 3/26/2025 |
| 9.0.29 | 9,024 | 3/18/2025 |
| 9.0.28 | 246 | 3/17/2025 |
| 9.0.27 | 238 | 3/16/2025 |
| 9.0.26 | 289 | 3/13/2025 |
| 9.0.25 | 52,135 | 3/9/2025 |
| 9.0.21 | 342 | 3/6/2025 |
| 9.0.20 | 19,618 | 3/6/2025 |
| 9.0.19 | 317 | 3/6/2025 |