5

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.

murray smith
  • 111
  • 1
  • 4

1 Answers1

8

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?

Yahya Hussein
  • 8,767
  • 15
  • 58
  • 114
leastprivilege
  • 18,196
  • 1
  • 34
  • 50
  • 4
    Do you have a hint on how to implement Single Sign On with IdentityServer4 and Company AD? – MDummy Dec 20 '16 at 09:39
  • The link where you specified the place we should update in AccountController is broken, can you please provide an updated one? – Yahya Hussein Nov 07 '17 at 13:24