FML.Infrastructure.Auth 1.0.0

FML.Infrastructure.Auth

Authentication infrastructure for FML applications.

Installation

dotnet add package FML.Infrastructure.Auth --source https://nuget.freakmylife.fr/v3/index.json

Components

IUserContextRetriever

Retrieve the current user's ID from HTTP context.

// In Program.cs
services.AddUserContextRetriever();

// In your service
public class MyService(IUserContextRetriever userContext)
{
    public void DoSomething()
    {
        var userId = userContext.GetUserId();
    }
}

ClaimsExtensions

Extension methods for working with JWT claims.

// Get user ID from ClaimsPrincipal
Guid? userId = User.GetUserId();

// Get user name
string userName = User.GetUserName();

// Check if user has a role
bool isAdmin = User.HasRole("admin");

// Get user ID from JWT string
Guid userId = "Bearer eyJ...".GetUserId();

Showing the top 20 packages that depend on FML.Infrastructure.Auth.

Packages Downloads
FML.Infrastructure.Data
Data access infrastructure (ICrudRepository, IUnitOfWork, QueryableExtensions)
2

Version Downloads Last updated
1.0.0 2 02/07/2026