Franz.Common.Identity
1.2.62
dotnet add package Franz.Common.Identity --version 1.2.62
NuGet\Install-Package Franz.Common.Identity -Version 1.2.62
<PackageReference Include="Franz.Common.Identity" Version="1.2.62" />
paket add Franz.Common.Identity --version 1.2.62
#r "nuget: Franz.Common.Identity, 1.2.62"
// Install Franz.Common.Identity as a Cake Addin #addin nuget:?package=Franz.Common.Identity&version=1.2.62 // Install Franz.Common.Identity as a Cake Tool #tool nuget:?package=Franz.Common.Identity&version=1.2.62
Franz.Common.Identity
A foundational library within the Franz Framework that provides tools for managing identity context across ASP.NET Core applications. This package simplifies access to user identity information, supporting dependency injection for streamlined integration with other components.
Features
- Identity Context Management:
IdentityContextAccessor
for accessing user identity data in a consistent manner across applications.
- Dependency Injection:
- Seamless integration with dependency injection via the Franz.Common.DependencyInjection package.
Version Information
- Current Version: 1.2.62
- Part of the private Franz Framework ecosystem.
Dependencies
This package relies on:
- Franz.Common.DependencyInjection: Provides dependency injection utilities to simplify service registration.
Installation
From Private Azure Feed
Since this package is hosted privately, configure your NuGet client:
dotnet nuget add source "https://your-private-feed-url" \
--name "AzurePrivateFeed" \
--username "YourAzureUsername" \
--password "YourAzurePassword" \
--store-password-in-clear-text
Install the package:
dotnet add package Franz.Common.Identity --version 1.2.62
Usage
1. Access Identity Context
The IdentityContextAccessor
simplifies access to the current user's identity data:
using Franz.Common.Identity;
public class MyService
{
private readonly IdentityContextAccessor _identityContextAccessor;
public MyService(IdentityContextAccessor identityContextAccessor)
{
_identityContextAccessor = identityContextAccessor;
}
public string GetUserId()
{
return _identityContextAccessor.User?.FindFirst("sub")?.Value;
}
}
2. Register Identity Context
Integrate IdentityContextAccessor
into your application:
using Franz.Common.Identity;
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<IdentityContextAccessor>(); // Register the accessor
}
}
Integration with Franz Framework
The Franz.Common.Identity package integrates seamlessly with:
- Franz.Common.DependencyInjection: Simplifies registration of the identity context in ASP.NET Core applications.
Ensure this dependency is installed to fully utilize the package's capabilities.
Contributing
This package is part of a private framework. Contributions are limited to the internal development team. If you have access, follow these steps:
- Clone the repository.
- Create a feature branch.
- Submit a pull request for review.
License
This library is licensed under the MIT License. See the LICENSE
file for more details.
Changelog
Version 1.2.62
- Introduced
IdentityContextAccessor
for accessing user identity data. - Full compatibility with Franz.Common.DependencyInjection.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. 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. |
-
net8.0
- Franz.Common.DependencyInjection (>= 1.2.62)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Franz.Common.Identity:
Package | Downloads |
---|---|
Franz.Common.Messaging.Identity
Shared utility library for the Franz Framework. |
|
Franz.Common.Http.Client
Shared utility library for the Franz Framework. |
|
Franz.Common.Http.Identity
Shared utility library for the Franz Framework. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.2.62 | 57 | 1/8/2025 |