Franz.Common.Http.Identity 1.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Franz.Common.Http.Identity --version 1.3.0
                    
NuGet\Install-Package Franz.Common.Http.Identity -Version 1.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Franz.Common.Http.Identity" Version="1.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Franz.Common.Http.Identity" Version="1.3.0" />
                    
Directory.Packages.props
<PackageReference Include="Franz.Common.Http.Identity" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Franz.Common.Http.Identity --version 1.3.0
                    
#r "nuget: Franz.Common.Http.Identity, 1.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Franz.Common.Http.Identity@1.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Franz.Common.Http.Identity&version=1.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Franz.Common.Http.Identity&version=1.3.0
                    
Install as a Cake Tool

Franz.Common.Http.Identity

A utility library within the Franz Framework that enhances ASP.NET Core identity management for HTTP-based applications. This package provides tools for accessing and managing identity context in a consistent and efficient manner.


Features

  • Identity Context Access:
    • IdentityContextAccessor for simplified access to the current user's identity information in HTTP requests.
  • Dependency Injection:
    • ServiceCollectionExtensions for seamless integration of identity-related services.

Version Information

  • Current Version: 1.3
  • Part of the private Franz Framework ecosystem.

Dependencies

This package relies on:

  • Microsoft.AspNetCore.Mvc.Core (2.2.5): Core MVC functionalities for identity and authentication.
  • Franz.Common.Identity: Core identity utilities and extensions.
  • Franz.Common.Http: HTTP utilities and middleware extensions.
  • Franz.Common.Headers: Header management utilities for HTTP applications.

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.Http.Identity --Version 1.2.65

Usage

1. Access Identity Context

Leverage IdentityContextAccessor to access the current user's identity information:

using Franz.Common.Http.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 Utilities

Use ServiceCollectionExtensions to register identity-related services:

using Franz.Common.Http.Identity.Extensions;

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddIdentityContext(); // Registers identity context utilities
    }
}

3. Use Identity Context in Controllers

Access identity data directly in controllers:

[ApiController]
[Route("api/[controller]")]
public class UserController : ControllerBase
{
    private readonly IdentityContextAccessor _identityContextAccessor;

    public UserController(IdentityContextAccessor identityContextAccessor)
    {
        _identityContextAccessor = identityContextAccessor;
    }

    [HttpGet("me")]
    public IActionResult GetCurrentUser()
    {
        var userId = _identityContextAccessor.User?.FindFirst("sub")?.Value;
        return Ok(new { UserId = userId });
    }
}

Integration with Franz Framework

The Franz.Common.Http.Identity package integrates seamlessly with:

  • Franz.Common.Identity: Provides foundational identity utilities.
  • Franz.Common.Http: Enhances HTTP functionality for identity-based applications.
  • Franz.Common.Headers: Simplifies header-based identity management.

Ensure these dependencies are installed to fully leverage the library'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:

  1. Clone the repository. @ https://github.com/bestacio89/Franz.Common/
  2. Create a feature branch.
  3. 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.65

  • Upgrade version to .net 9

Version 1.3

  • Upgraded to .NET 9.0.8
  • Added new features and improvements
  • Separated business concepts from mediator concepts
  • Now compatible with both the in-house mediator and MediatR
Product 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.  net10.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Franz.Common.Http.Identity:

Package Downloads
Franz.Common.SSO

Shared utility library for the Franz Framework.

Franz.Common.Http.Bootstrap

Shared utility library for the Franz Framework.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.6.3 64 10/9/2025
1.6.2 116 10/7/2025
1.5.9 181 9/24/2025
1.5.4 172 9/23/2025
1.5.3 209 9/21/2025
1.5.2 215 9/21/2025
1.5.0 213 9/21/2025
1.4.4 189 9/20/2025
1.3.14 302 9/18/2025
1.3.13 296 9/18/2025
1.3.5 297 9/17/2025
1.3.4 297 9/16/2025
1.3.3 296 9/16/2025
1.3.2 284 9/15/2025
1.3.1 103 9/12/2025
1.3.0 304 8/25/2025
1.2.65 196 3/3/2025
1.2.64 131 1/29/2025
1.2.63 147 1/27/2025
1.2.62 111 1/8/2025