I'm having trouble figuring out how to implement custom authentication in my IdentityServer4 implementation that will authenticate against active directory. Note: I need to authenticate against my company's active directory server, it's not azure active directory.
It's not clear to me whether I need to create some new middleware and add it using IApplicationBuilder in my ASP.NET Core server or whether I need to add something to IdentityServer itself.
I found another link that described how to integrate with active directory but it created an implementation of the IUserService interface and it seems to be for an earlier version of IdentityServer because I believe IUserService is not present in IdentityServer4.
Any help is appreciated.
In IdentityServer4 it is your responsibility to implement the login code and provide the login UI. We have a sample UI project (with controllers) for getting started:
https://github.com/IdentityServer/IdentityServer4.Quickstart.UI
In there you will find the AccountController
- this is where you implement your authentication logic.
Simply exchange that code with your own. In case of Active Directory, have a look here:
Validate a username and password against Active Directory?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With