Official .NET SDK for Authorizer.dev authentication service. Supports OAuth2, JWT token authentication, and user management for ASP.NET Core, Blazor, and other .NET applications. Features simplified API, token-based authentication, and comprehensive error handling.
$ dotnet add package Authorizer.DotNetOfficial .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"
}
}
All documentation has been consolidated into one comprehensive guide covering:
Explore working examples in the samples/ directory:
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"
ClientId is correct in configuration"HTTP 422 Cross-Domain Errors"
CookieDomain = ".example.com""Connection Timeout"
HttpTimeout in configuration# 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