This package offers a comprehensive authentication system built with C# on the .NET 8 framework. It encompasses essential components, including a token provider, password manager, user manager, and sign-in manager.
Access-forge streamlines development by providing a customizable, ready-to-use authentication system that integrates seamlessly with a single method call, allowing developers to focus on core application features.
Use .Net CLI to install the package
dotnet add package access-forge --version 1.0.0To use access-forge to authenticate users
var tokenSecret = "123456AccessForge@!2092000111@@wqrys";
var connectionString = "Server=localhost\\SQLEXPRESS;Database=AccessForge;Trusted_Connection=True;TrustServerCertificate=true;";
services.AddIdentityService<IdentityDbContext>(options =>
{
options.UseSqlServer(connectionString);
})
.AddJwtBearer(s =>
{
s.TokenSecret = tokenSecret;
s.AuthenticationScheme = JwtBearerDefaults.AuthenticationScheme;
s.ExpirationTime = 30;
});AccessResult<User> result = userManager.CreateUser(user);SignInResult<User> result = signInManager.SignInByEmail(email, password);