Rystem.Authentication.Social.Blazor
9.0.1
dotnet add package Rystem.Authentication.Social.Blazor --version 9.0.1
NuGet\Install-Package Rystem.Authentication.Social.Blazor -Version 9.0.1
<PackageReference Include="Rystem.Authentication.Social.Blazor" Version="9.0.1" />
paket add Rystem.Authentication.Social.Blazor --version 9.0.1
#r "nuget: Rystem.Authentication.Social.Blazor, 9.0.1"
// Install Rystem.Authentication.Social.Blazor as a Cake Addin #addin nuget:?package=Rystem.Authentication.Social.Blazor&version=9.0.1 // Install Rystem.Authentication.Social.Blazor as a Cake Tool #tool nuget:?package=Rystem.Authentication.Social.Blazor&version=9.0.1
What is Rystem?
Rystem.Authentication.Social.Blazor
This project would be a super project to help the api creator to have fast api behind business interfaces and services dispatched through dependency injection.
Install javascript
Setup js in app.razor in head or at the end
<script src="_content/Rystem.Authentication.Social.Blazor/socialauthentications.js"></script>
DI - Example
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
builder.Services.AddSocialLoginUI(x =>
{
x.ApiUrl = "https://localhost:7017";
x.Google.ClientId = builder.Configuration["SocialLogin:Google:ClientId"];
x.Microsoft.ClientId = builder.Configuration["SocialLogin:Microsoft:ClientId"];
});
builder.Services.AddRepository<SocialRole, string>(repositoryBuilder =>
{
repositoryBuilder.WithApiClient(apiBuilder =>
{
apiBuilder.WithHttpClient("https://localhost:7017").WithDefaultRetryPolicy();
});
});
builder.Services.AddDefaultAuthorizationInterceptorForApiHttpClient();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error", createScopeForErrors: true);
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseAntiforgery();
app
.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();
app.Run();
Example for Routes.razor
<SocialAuthenticationRouter AppAssembly="typeof(Program).Assembly" DefaultLayout="typeof(Layout.MainLayout)">
</SocialAuthenticationRouter>
Example for logout
You may use the logout button
<SocialLogout></SocialLogout>
or create your custom logout through the SocialUser cascade parameter
[CascadingParameter(Name = "SocialUser")]
public SocialUserWrapper? SocialUser { get; set; }
private async ValueTask LogoutAsync()
{
if (SocialUser != null)
await SocialUser.LogoutAsync(false);
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. |
-
net9.0
- Microsoft.AspNetCore.Components.Authorization (>= 9.0.0)
- Microsoft.AspNetCore.Components.Web (>= 9.0.0)
- Microsoft.Extensions.Http (>= 9.0.0)
- Microsoft.Identity.Abstractions (>= 7.2.0)
- Microsoft.JSInterop (>= 9.0.0)
- Rystem (>= 9.0.0)
- Rystem.Authentication.Social.Abstractions (>= 9.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Rystem.Authentication.Social.Blazor:
Package | Downloads |
---|---|
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 |
---|---|---|
9.0.1 | 45 | 11/16/2024 |
9.0.0 | 50 | 11/16/2024 |
9.0.0-rc.1 | 74 | 10/18/2024 |
6.2.0 | 218,992 | 10/9/2024 |
6.1.1 | 91 | 10/9/2024 |
6.1.0 | 47,874 | 9/29/2024 |
6.0.24 | 123 | 9/11/2024 |
6.0.23 | 138 | 9/11/2024 |
6.0.21 | 339,986 | 6/18/2024 |
6.0.20 | 727,608 | 6/16/2024 |
6.0.19 | 30,355 | 6/14/2024 |
6.0.18 | 102 | 6/14/2024 |
6.0.17 | 101 | 6/14/2024 |
6.0.16 | 49,951 | 6/10/2024 |
6.0.15 | 106 | 6/9/2024 |
6.0.14 | 94,260 | 5/24/2024 |
6.0.13 | 119 | 5/23/2024 |
6.0.12 | 111 | 5/23/2024 |
6.0.11 | 123 | 5/20/2024 |
6.0.10 | 114 | 5/20/2024 |
6.0.9 | 123 | 5/20/2024 |
6.0.8 | 108 | 5/19/2024 |
6.0.7 | 155 | 5/18/2024 |