Official .NET SDK for Authorizer.dev - A comprehensive authentication and authorization service for .NET applications.
dotnet add package Authorizer.DotNet// Configure in Program.cs
builder.Services.AddAuthorizer(builder.Configuration, "Authorizer");
// Use in your code
public class AuthController : ControllerBase
{
private readonly IAuthorizerClient _client;
public AuthController(IAuthorizerClient client) => _client = client;
[HttpPost("login")]
public async Task<IActionResult> Login([FromBody] LoginRequest request)
{
var response = await _client.LoginAsync(request);
return response.IsSuccess ? Ok(response.Data) : BadRequest(response.Errors);
}
}// appsettings.json
{
"Authorizer": {
"AuthorizerUrl": "https://your-authorizer-instance.com",
"ClientId": "your-client-id",
"RedirectUrl": "https://your-app.com/auth/callback"
}
}- 🔐 Complete authentication (login, signup, OAuth, JWT)
- 🛡️ Multi-factor authentication (OTP, TOTP)
- ✉️ Passwordless magic link authentication
- 👤 User & session management
- 🎯 Multi-framework support (ASP.NET Core, Blazor, Console)
- 🔄 .NET 6.0, 7.0, and 8.0 compatible
- ⚡ Production-ready with comprehensive testing
All documentation has been consolidated into one comprehensive guide covering:
- Installation & Configuration
- All Authentication Methods
- Complete API Reference
- Sample Applications
- Advanced Topics (Cross-Domain, OAuth, MFA, etc.)
- Testing & Troubleshooting
- Migration Guides
Explore working examples in the samples/ directory:
- ASP.NET Core API - REST API with Swagger
- Blazor Server - Full web app with UI
- Console App - Interactive CLI
- JWT API - JWT Bearer authentication
Run any sample:
cd samples/Authorizer.Sample.BlazorServer
dotnet run// Authentication
await client.LoginAsync(request);
await client.SignupAsync(request);
await client.MagicLinkLoginAsync(request);
await client.AuthorizeAsync(request); // OAuth
await client.LogoutAsync(token);
// User Management
await client.GetProfileAsync(token);
await client.UpdateProfileAsync(request, token);
await client.GetSessionAsync();
// Password Management
await client.ForgotPasswordAsync(request);
await client.ResetPasswordAsync(request);
await client.ChangePasswordAsync(request);
// MFA
await client.VerifyOtpAsync(request);
await client.ResendOtpAsync(request);
// Utilities
await client.GetMetaAsync(); // Feature detection
await client.ValidateJwtAsync(token);"HTTP 401 Unauthorized"
- Verify
ClientIdis correct in configuration
"HTTP 422 Cross-Domain Errors"
- Configure
CookieDomain = ".example.com" - See Cross-Domain Authentication
"Connection Timeout"
- Increase
HttpTimeoutin configuration - Check network connectivity
# Run all tests (137 total: 115 unit + 22 integration)
dotnet test
# Run unit tests only
dotnet test tests/Authorizer.DotNet.UnitTests/
# Run integration tests (requires Authorizer instance)
dotnet test tests/Authorizer.DotNet.IntegrationTests/Contributions are welcome! Please see DOCUMENTATION.md for guidelines.
See CHANGELOG.md for version history and breaking changes.
MIT License - see LICENSE file for details.
Made with ❤️ in London