Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IdentityServer4 custom authentication with active directory

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.

like image 688
murray smith Avatar asked Mar 10 '23 11:03

murray smith


1 Answers

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?

like image 189
leastprivilege Avatar answered May 09 '23 13:05

leastprivilege