![]() |
VOOZH | about |
dotnet add package Rystem.Authentication.Social --version 10.0.8
NuGet\Install-Package Rystem.Authentication.Social -Version 10.0.8
<PackageReference Include="Rystem.Authentication.Social" Version="10.0.8" />
<PackageVersion Include="Rystem.Authentication.Social" Version="10.0.8" />Directory.Packages.props
<PackageReference Include="Rystem.Authentication.Social" />Project file
paket add Rystem.Authentication.Social --version 10.0.8
#r "nuget: Rystem.Authentication.Social, 10.0.8"
#:package Rystem.Authentication.Social@10.0.8
#addin nuget:?package=Rystem.Authentication.Social&version=10.0.8Install as a Cake Addin
#tool nuget:?package=Rystem.Authentication.Social&version=10.0.8Install as a Cake Tool
Rystem.Authentication.Social is the server-side social-login package in the Authentication area.
It is not a full identity platform. Its job is narrower:
ITokenChecker/User endpointdotnet add package Rystem.Authentication.Social
The server package revolves around two entry points:
AddSocialLogin<TProvider>(...)UseSocialLoginEndpoints()The high-level flow is:
SocialLoginBuilderISocialUserProvider for app-specific claims and user payloadsAddSocialLogin<TProvider>(...)UseSocialLoginEndpoints()The package then issues standard ASP.NET bearer tokens through Results.SignIn(...).
The real public registration method is:
builder.Services.AddSocialLogin<MySocialUserProvider>(settings =>
{
settings.Google.ClientId = builder.Configuration["SocialLogin:Google:ClientId"];
settings.Google.ClientSecret = builder.Configuration["SocialLogin:Google:ClientSecret"];
settings.Google.AddUris("https://localhost:7100", "https://app.example.com");
settings.Microsoft.ClientId = builder.Configuration["SocialLogin:Microsoft:ClientId"];
settings.Microsoft.ClientSecret = builder.Configuration["SocialLogin:Microsoft:ClientSecret"];
settings.Microsoft.AddUris("https://localhost:7100", "https://app.example.com");
settings.GitHub.ClientId = builder.Configuration["SocialLogin:GitHub:ClientId"];
settings.GitHub.ClientSecret = builder.Configuration["SocialLogin:GitHub:ClientSecret"];
}, bearer =>
{
bearer.BearerTokenExpiration = TimeSpan.FromHours(1);
bearer.RefreshTokenExpiration = TimeSpan.FromDays(10);
});
Signature:
IServiceCollection AddSocialLogin<TProvider>(
Action<SocialLoginBuilder> settings,
Action<BearerTokenOptions>? action = null,
ServiceLifetime userProviderLifeTime = ServiceLifetime.Transient)
where TProvider : class, ISocialUserProvider
What it registers:
ISocialUserProviderITokenChecker per provider, plus the internal DotNet checker for refresh-token reuseHttpClients only for providers whose configuration is activeSocialLoginBuilder currently exposes these providers:
GoogleMicrosoftFacebookGitHubAmazonLinkedinXInstagramPinterestTikTokThe activation rules depend on the settings type:
| Settings type | Used by | Active when |
|---|---|---|
SocialDefaultLoginSettings |
Facebook, Amazon | always true |
SocialLoginSettings |
base type | ClientId != null |
SocialLoginWithSecretsSettings |
GitHub | ClientId and ClientSecret are set |
SocialLoginWithSecretsAndRedirectSettings |
Google, Microsoft, Linkedin, X, Instagram, Pinterest, TikTok | client id, client secret, and at least one allowed URI are set |
For redirect-based providers, add allowed origins with:
settings.Google.AddUri("https://app.example.com");
settings.Google.AddUris("https://app.example.com", "https://staging.example.com");
settings.Google.AddDomainWithProtocolAndPort("localhost", "https", 7100);
Important detail: allowed redirects are matched by scheme, host, and port. The stored path is not used as a differentiator when validating the incoming domain.
ISocialUserProviderISocialUserProvider is the application extension point.
public interface ISocialUserProvider
{
Task<ISocialUser> GetAsync(string username, IEnumerable<Claim> claims, CancellationToken cancellationToken);
IAsyncEnumerable<Claim> GetClaimsAsync(TokenResponse response, CancellationToken cancellationToken);
}
Responsibilities:
GetClaimsAsync(...) controls which claims are embedded into the issued bearer tokenGetAsync(...) controls what /api/Authentication/Social/User returnsThe sample provider in src/Authentication/Tests/Rystem.Authentication.Social.TestApi/Services/SocialUserProvider.cs shows both:
ClaimTypes.NameRystemClaimTypes.LanguageISocialUserExpose the runtime endpoints with:
app.UseSocialLoginEndpoints();
This method does more than mapping endpoints: it also calls UseAuthentication() and UseAuthorization() internally.
api/Authentication/Social/TokenThis endpoint is mapped with Map(...), so it accepts any verb. In practice the bundled clients use:
GET for simple exchangesPOST when they need to send extra body parameters such as code_verifierInputs:
| Name | Source | Meaning |
|---|---|---|
provider |
query | ProviderType value |
code |
query | authorization code, provider access token, or refresh token depending on provider |
redirectPath |
query | optional redirect path from the client |
additionalParameters |
JSON body | optional provider-specific extras like PKCE code_verifier |
Behavior:
Origin first, then RefererTokenCheckerSettings object with Domain, RedirectPath, and AdditionalParametersITokenCheckerClaimsPrincipal and returns Results.SignIn(...)The actual wire payload is the ASP.NET bearer-token sign-in response, not a custom social-auth DTO.
api/Authentication/Social/UserThis endpoint requires authorization and returns either:
ISocialUserProvider.GetAsync(...) output, when a provider is registeredISocialUser.OnlyUsername(...) when no provider is availableDotNet providerProviderType.DotNet is the package's internal refresh path, not a social provider.
It validates a refresh token previously issued by ASP.NET bearer auth and only accepts it when the original token domain matches the current request domain claim.
Origin or Referer is effectively requiredThe token endpoint refuses to proceed when it cannot infer a non-empty domain from Origin or Referer, even for providers that do not use redirect whitelists in their settings object.
The overall contract supports redirectPath, but provider implementations are not fully uniform. Some use the computed redirect URI, while others rely on harder-coded callback shapes.
For redirect-whitelist providers, matching is based on scheme, host, and port. Multiple callback paths on the same host are not distinguished during domain validation.
Your claims and /User payload come from ISocialUserProvider. Without it, the package falls back to a username-only response.
src/Authentication/Tests/Rystem.Authentication.Social.TestApi/Program.cssrc/Authentication/Tests/Rystem.Authentication.Social.TestApi/Services/SocialUserProvider.cssrc/Authentication/Rystem.Authentication.Social/Extensions/ServiceCollectionExtensions.cssrc/Authentication/Rystem.Authentication.Social/Extensions/EndpointRouteBuilderExtensions.csUse this package when you want a small ASP.NET Core token-exchange backend for social-login clients, not a full end-to-end identity platform.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.8 | 5,492 | 5/13/2026 |
| 10.0.7 | 125 | 3/26/2026 |
| 10.0.6 | 433,507 | 3/3/2026 |
| 10.0.5 | 129 | 2/22/2026 |
| 10.0.4 | 138 | 2/9/2026 |
| 10.0.3 | 147,921 | 1/28/2026 |
| 10.0.1 | 209,101 | 11/12/2025 |
| 9.1.3 | 334 | 9/2/2025 |
| 9.1.2 | 764,498 | 5/29/2025 |
| 9.1.1 | 97,869 | 5/2/2025 |
| 9.0.33 | 275 | 4/30/2025 |
| 9.0.32 | 186,754 | 4/15/2025 |
| 9.0.31 | 5,886 | 4/2/2025 |
| 9.0.30 | 88,876 | 3/26/2025 |
| 9.0.29 | 9,045 | 3/18/2025 |
| 9.0.28 | 261 | 3/17/2025 |
| 9.0.27 | 277 | 3/16/2025 |
| 9.0.26 | 304 | 3/13/2025 |
| 9.0.25 | 52,176 | 3/9/2025 |
| 9.0.21 | 403 | 3/6/2025 |