AsyncAuthFlowCore 4.0.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package AsyncAuthFlowCore --version 4.0.0
                    
NuGet\Install-Package AsyncAuthFlowCore -Version 4.0.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="AsyncAuthFlowCore" Version="4.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AsyncAuthFlowCore" Version="4.0.0" />
                    
Directory.Packages.props
<PackageReference Include="AsyncAuthFlowCore" />
                    
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 AsyncAuthFlowCore --version 4.0.0
                    
#r "nuget: AsyncAuthFlowCore, 4.0.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 AsyncAuthFlowCore@4.0.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=AsyncAuthFlowCore&version=4.0.0
                    
Install as a Cake Addin
#tool nuget:?package=AsyncAuthFlowCore&version=4.0.0
                    
Install as a Cake Tool

AuthFlow

AuthFlow is a versatile .NET library designed to streamline the authentication and authorization process for applications. By providing a highly configurable user context, AuthFlow enables developers to easily define and enforce permission requirements, manage user access, and handle exceptions in a robust and scalable manner.

Features

  • Flexible Configuration: Set up user contexts with specific permissions and actions using a fluent API.
  • Permission Verification: Seamlessly integrate with existing user permission repositories to verify access rights.
  • Asynchronous Support: Built for modern applications with async/await patterns, ensuring non-blocking I/O operations.
  • Comprehensive Event Handling: React to permission grants, denials, operation cancellations, and exceptions with custom logic.
  • Easy Integration: Designed to fit into existing .NET projects with minimal setup.

Getting Started

To begin using AuthFlow in your project, install the package via NuGet:

dotnet add package AsyncAuthFlowCore

Configuring a User Context

Create and configure a user context by specifying permissions and defining actions for various outcomes:

var userContext = AuthFlow.UserContext.Create(userPermissionsRepository, "USER_ID")
    .RequirePermission("ADMIN_ACCESS")
    .OnPermissionGranted(async (userId, cancellationToken) =>
    {
        Console.WriteLine($"Permission Granted for {userId}.");
        // Code to execute when permission is granted
    })
    .OnPermissionDenied(async (userId, cancellationToken) =>
    {
        Console.WriteLine($"Permission Denied for {userId}.");
        // Code to execute when permission is denied
    })
    .OnException(async (exception, userId, cancellationToken) =>
    {
        Console.WriteLine($"Exception occurred for {userId}: {exception.Message}");
        // Exception handling code
    })
    .ExecuteAsync();

This example demonstrates setting up a user context with the required ADMIN_ACCESS permission. It configures actions to handle permission grants, denials, and exceptions.

Usage Scenarios

  • Web Applications: Secure endpoints or actions based on user roles and permissions.
  • Background Services: Ensure background tasks or jobs run with the appropriate user permissions.
  • Microservices: Apply user context in inter-service communication to maintain security and permission checks.

Contributing

We welcome contributions to AuthFlow! If you have suggestions, bug reports, or would like to contribute code, please submit an issue or pull request on GitHub. Your input helps make AuthFlow even better.

License

AuthFlow is released under the MIT License. See the LICENSE file in the repository for more details.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated