I have a question and simple request. I am trying to create simple authentication and authorization mechanism in blazor. Problem is base for that mechanism is not database but ldap (all examples and tutorial are based on database storage).
For what I understand now this in blazor it looks like this
In startup.cs I am adding default entity and storage (I have written a simple library based on novell LDAP library to get credentials to check if user exists in LDAP and get user group).
Using database it would look like (create default identity and setup storage)
// replace this with LDAP account validation
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(
Configuration.GetConnectionString("DefaultConnection")));
services.AddDefaultIdentity<IdentityUser>()
.AddEntityFrameworkStores<ApplicationDbContext>()
I know It would be possible using controller with routing to do this, but I wonder is there a more elegant way then adding a controller to blazor server app.
next I add revalidate to check user every single period of time:
services.AddScoped<AuthenticationStateProvider, RevalidatingIdentityAuthenticationStateProvider<IdentityUser>>();
and I add authorization and authentication to app:
app.UseAuthentication();
app.UseAuthorization();
But how would it look when I want to use other source of user data storage (in my example LDAP)?