NoGrind.SDK
1.1.3
dotnet add package NoGrind.SDK --version 1.1.3
NuGet\Install-Package NoGrind.SDK -Version 1.1.3
<PackageReference Include="NoGrind.SDK" Version="1.1.3" />
<PackageVersion Include="NoGrind.SDK" Version="1.1.3" />
<PackageReference Include="NoGrind.SDK" />
paket add NoGrind.SDK --version 1.1.3
#r "nuget: NoGrind.SDK, 1.1.3"
#:package NoGrind.SDK@1.1.3
#addin nuget:?package=NoGrind.SDK&version=1.1.3
#tool nuget:?package=NoGrind.SDK&version=1.1.3
NoGrind SDK
NoGrind is a modern authentication and authorization SDK for .NET applications, built with clean architecture principles. It provides plug-and-play authentication capabilities with extensive configuration options and follows industry best practices.
Features (v1.1.1)
- π Complete authentication and authorization management
- π Pluggable authentication provider system
- JWT authentication (v1)
- Future: OAuth2, Session-based auth, and more
- π₯ User management - Full CRUD operations with role management
- π‘οΈ Role-based access control (RBAC) - Fine-grained permission management
- ποΈ SQL script-based database initialization - Provider-specific scripts for PostgreSQL, SQL Server, and SQLite
- π§ Custom schema and table prefix support - Automated customization tools for multi-tenant and legacy integration
- βοΈ Highly configurable - JSON configuration or programmatic setup
- π Zero-downtime deployments - Automated database setup with MigrationHostedService
- π¦ Database agnostic - Works with PostgreSQL, SQL Server, SQLite, and more
- π Extensive documentation and examples - Complete guides and working example projects
Project Structure
The solution follows clean architecture principles with the following projects:
- NoGrind.Core - Contains domain entities and business logic
- NoGrind.Infrastructure - Implements interfaces defined in Core
- NoGrind.Application - Contains application logic
- NoGrind.SDK - Main entry point for consumers
- Example Projects - Usage examples
- Test Projects - Unit, integration, and functional tests
Getting Started
Quick Setup
Install NoGrind SDK
dotnet add package NoGrind.SDKAdd NoGrind to your application
// Program.cs builder.Services.AddNoGrind(options => { options.Authentication.Provider = AuthenticationProviderType.JWT; options.Authentication.JWT.Secret = "your-super-secret-key-that-is-at-least-32-characters-long"; options.Authentication.JWT.Issuer = "YourApp"; options.Authentication.JWT.Audience = "YourApp"; options.Database.IntegrationType = DatabaseIntegrationType.ConnectionString; options.Database.Provider = DatabaseProvider.PostgreSQL; options.Database.ConnectionString = "your-connection-string"; }); // Add middleware app.UseNoGrindMiddleware();For [Authorize] attributes and RequireAuthorization() - Add ASP.NET Core Authentication
dotnet add package Microsoft.AspNetCore.Authentication.JwtBearer// Program.cs - Add AFTER AddNoGrind() builder.Services.AddAuthentication("Bearer") .AddJwtBearer("Bearer", options => { options.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters { ValidateIssuer = true, ValidateAudience = true, ValidateLifetime = true, ValidateIssuerSigningKey = true, ValidIssuer = "YourApp", // Match your NoGrind JWT settings ValidAudience = "YourApp", IssuerSigningKey = new Microsoft.IdentityModel.Tokens.SymmetricSecurityKey( System.Text.Encoding.UTF8.GetBytes("your-super-secret-key-that-is-at-least-32-characters-long")), ClockSkew = TimeSpan.FromMinutes(1) }; }); builder.Services.AddAuthorization();Use in your controllers
[ApiController] [Route("api/[controller]")] public class UsersController : ControllerBase { private readonly IUserManager _userManager; public UsersController(IUserManager userManager) { _userManager = userManager; } [HttpGet] [Authorize] // Now works with NoGrind authentication public async Task<IActionResult> GetUsers() { var users = await _userManager.GetAllUsersAsync(); return Ok(users); } }
Documentation
Getting Started
- Getting Started Guide - Complete setup and configuration
- Configuration Guide - Detailed configuration options
- Authentication Setup - Authentication and authorization setup
Database Setup
- Database Setup Guide - SQL script-based database initialization
- Database Migrations - Migration infrastructure and database management
- Database Seeding - Configure initial data seeding
- Schema Customization - Custom schema names and table prefixes
Examples
- Example Web API - Complete working example with authentication
- Basic Setup - Minimal configuration example
- Authentication Examples - JWT, API keys, and cookie auth examples
For complete documentation and examples, see the docs/ folder and examples/ projects.
What's New in v1.1.1
Schema and Table Prefix Customization
NoGrind now supports custom schema names and table prefixes for maximum flexibility:
- Automated Customization Tools - PowerShell and Bash scripts for easy customization
- Multi-tenant Support - Use different prefixes for tenant isolation
- Legacy Integration - Match your existing database naming conventions
- CI/CD Ready - Integrate customization into deployment pipelines
See the Schema Customization Guide for details.
Example Usage
# Windows (PowerShell)
.\customize-scripts.ps1 -SchemaName "mycompany" -TablePrefix "APP_" -Provider postgres
# Unix/Linux/macOS (Bash)
./customize-scripts.sh -s mycompany -p APP_ -d postgres
Version History
- v1.1.1 - Schema and table prefix customization support with automated tools
- v1.1.0 - SQL script-based database initialization with provider-specific scripts
- v1.0.x - Initial release with JWT authentication and EF Core migrations
Publish to NuGet (maintainers)
You can publish the SDK to NuGet.org via a tagged release or manually from your machine.
CI publish (recommended)
Prerequisites:
- A repository secret named
NUGET_API_KEY(preferred) orNOGRIND_API_KEYcontaining a NuGet.org API key with push permissions forNoGrind.SDK.
Steps:
- Ensure main is green (build/tests passing), then create and push a tag matching the version you want to publish:
git tag v1.1.2 git push origin v1.1.2 - GitHub Actions workflow
.github/workflows/nuget-publish.ymlwill:- Restore, build, pack the SDK
- Use the tag (without the leading
v) as the package version - Push the package to NuGet.org
Verification:
- Check Actions β βPublish NoGrind.SDK to NuGetβ to confirm success.
- Once completed, verify on NuGet:
- https://www.nuget.org/packages/NoGrind.SDK
- New versions can take a few minutes to appear in search.
Notes:
- The workflow prefers
NUGET_API_KEYbut falls back toNOGRIND_API_KEYif present. - To re-publish a failed version, either push a new tag (e.g.,
v1.1.3) or re-run the failed Action run after fixing secrets.
Manual publish (local)
If you need to pack/publish locally:
# From repository root
dotnet build NoGrind.sln -c Release
dotnet pack src/NoGrind.SDK/NoGrind.SDK.csproj -c Release \
-p:PackageVersion=1.1.2 \
-p:ContinuousIntegrationBuild=true \
-o dist
# Publish to NuGet.org
dotnet nuget push dist/NoGrind.SDK.1.1.2.nupkg \
--api-key "$NUGET_API_KEY" \
--source https://api.nuget.org/v3/index.json
Tips:
- Keep the tag version and package version aligned (CI derives version from tag).
- The SDK includes XML docs and SourceLink for a better developer experience.
License
This project is licensed under the MIT License - see the LICENSE file for details.
| 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. 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. |
-
net8.0
- Microsoft.AspNetCore.Components (>= 8.0.12)
- Microsoft.AspNetCore.Components.Web (>= 8.0.12)
- Microsoft.EntityFrameworkCore (>= 9.0.5)
- Microsoft.EntityFrameworkCore.Relational (>= 9.0.5)
- Microsoft.EntityFrameworkCore.Sqlite (>= 9.0.5)
- Microsoft.EntityFrameworkCore.SqlServer (>= 9.0.5)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.5)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.5)
- Microsoft.Extensions.Configuration.Json (>= 9.0.5)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.5)
- Microsoft.Extensions.Options (>= 9.0.5)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.5)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 9.0.3)
- System.IdentityModel.Tokens.Jwt (>= 8.10.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.