Hexalith.DaprIdentityStore
1.57.3
dotnet add package Hexalith.DaprIdentityStore --version 1.57.3
NuGet\Install-Package Hexalith.DaprIdentityStore -Version 1.57.3
<PackageReference Include="Hexalith.DaprIdentityStore" Version="1.57.3" />
<PackageVersion Include="Hexalith.DaprIdentityStore" Version="1.57.3" />
<PackageReference Include="Hexalith.DaprIdentityStore" />
paket add Hexalith.DaprIdentityStore --version 1.57.3
#r "nuget: Hexalith.DaprIdentityStore, 1.57.3"
#addin nuget:?package=Hexalith.DaprIdentityStore&version=1.57.3
#tool nuget:?package=Hexalith.DaprIdentityStore&version=1.57.3
Hexalith.DaprIdentityStore Core Library
This folder contains the core implementation of the Hexalith.DaprIdentityStore library.
For complete documentation, installation instructions, and usage examples, please refer to the main project README.
Project Structure
- Actors/: Contains the Dapr actor implementations for identity management
- States/: Contains actor state definitions and models
- Interfaces/: Contains service and repository interfaces
- Services/: Contains concrete implementations of identity services
Development
This library is part of the Hexalith.DaprIdentityStore solution. For development guidelines and contribution information, please see the main project documentation.
Quick Links
External Identity Provider Roles Synchronization
This feature allows synchronizing user roles from external identity providers to the local identity store when users log in using external authentication providers.
How It Works
When a user logs in or links an account with an external identity provider (such as Google, Microsoft, Okta, etc.), the system:
- Authenticates the user through the external provider
- Extracts role claims from the external provider's user principal
- Synchronizes these roles with the local identity store
The synchronization happens in the following scenarios:
- When an existing user logs in via an external provider
- When a new user creates an account via an external provider
- When a user links a new external provider to their existing account
Supported Role Claim Types
The system looks for role claims with the following claim types:
ClaimTypes.Role
(http://schemas.microsoft.com/ws/2008/06/identity/claims/role)role
(common in OAuth providers)roles
(used by some identity providers)- Any claim type ending with
/roles
(common in JWT formats)
Implementation
The implementation is provided by the ExternalLoginExtensions.cs
class, which extends UserManager<CustomUser>
with the SyncExternalProviderRolesAsync
method.
public static async Task SyncExternalProviderRolesAsync(
this UserManager<CustomUser> userManager,
CustomUser user,
ExternalLoginInfo externalLoginInfo)
Configuring External Identity Providers
When configuring external identity providers, ensure they are set up to include role claims in the authentication token. The specific configuration varies by provider, but generally involves:
- Registering your application with the external provider
- Configuring the proper scopes and claims mapping
- Setting up roles/groups in the external provider
- Mapping those roles to appropriate claims in the token
Notes
- Roles are synchronized during login, so changes in external provider roles will be reflected on the next login
- The system only adds roles from the external provider; it does not remove local roles
- If a role doesn't exist in the local system but is provided by the external provider, it will be added to the user
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. 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. |
-
net9.0
- AspNet.Security.OAuth.GitHub (>= 9.1.0)
- AspNet.Security.OAuth.Twitter (>= 9.2.0)
- Google.Apis.Auth.AspNetCore3 (>= 1.69.0)
- Hexalith.Application.Partitions.Abstractions (>= 1.56.0)
- Hexalith.Application.Sessions.Abstractions (>= 1.56.0)
- Hexalith.DaprIdentityStore.Abstractions (>= 1.57.3)
- Hexalith.Infrastructure.DaprRuntime (>= 1.56.0)
- Microsoft.AspNetCore.Authentication.Facebook (>= 9.0.4)
- Microsoft.AspNetCore.Authentication.MicrosoftAccount (>= 9.0.4)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Hexalith.DaprIdentityStore:
Package | Downloads |
---|---|
Hexalith.DaprIdentityStore.UI
Hexalith is a set of libraries to build a micro-service architecture. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
1.57.3 | 303 | 4/16/2025 | |
1.57.2 | 277 | 4/16/2025 | |
1.57.1 | 292 | 4/15/2025 | |
1.57.0 | 280 | 4/15/2025 | |
1.56.0 | 229 | 4/13/2025 | |
1.53.6 | 289 | 3/19/2025 | |
1.53.5 | 260 | 3/19/2025 | |
1.53.4 | 254 | 3/18/2025 | |
1.53.3 | 286 | 3/11/2025 | |
1.53.0 | 211 | 2/28/2025 | |
1.52.16 | 206 | 1/27/2025 | |
1.52.14 | 217 | 1/15/2025 | |
1.52.13 | 179 | 1/14/2025 | |
1.52.10 | 209 | 1/10/2025 | |
1.52.8 | 226 | 1/6/2025 | |
1.52.7 | 193 | 1/6/2025 | |
1.52.5 | 207 | 12/31/2024 | |
1.52.2 | 191 | 12/26/2024 | |
1.51.18 | 197 | 12/22/2024 | |
1.51.17 | 197 | 12/20/2024 | |
1.51.15 | 203 | 12/17/2024 | |
1.51.14 | 190 | 12/16/2024 | |
1.51.9 | 219 | 12/15/2024 | |
1.51.7 | 237 | 12/15/2024 | |
1.0.0 | 230 | 12/15/2024 | |
0.8.0 | 263 | 12/7/2024 | |
0.4.0 | 262 | 11/26/2024 | |
0.3.0 | 326 | 11/25/2024 | |
0.2.0 | 201 | 11/23/2024 | |
0.1.0 | 238 | 11/20/2024 |