1

I manage to understand how Web APIs work and I have to create a centralized secure authentication system for our intranet.

The problem is that i need to do this using Web API and LDAP and i cannot find any example with enough documentation to get a simple system up and running for testing

It should be simple in theory, Client sends username and password encrypted through json to web api, web api validates user against ldap and creates token with user data and sends it back.

ruipascoal
  • 47
  • 2
  • 12
  • https://learn.microsoft.com/en-us/dotnet/api/system.directoryservices?view=netframework-4.7.2&viewFallbackFrom=netcore-2.0 –  Mar 24 '19 at 19:08
  • https://stackoverflow.com/a/33287996/9105725 –  Mar 24 '19 at 19:34

1 Answers1

2

System.DirectoryServices is available from .net core 2.1 , you can read more here. If using .Net 2.0 , you can use Windows Compatibility Pack for .NET Core or Novell.Directory.Ldap.NETStandard to validate the credential With AD . See code samples from here .

Now you can secure your ASP.NET Core API with JWT Authentication .The common process is your client collect user's credential and pass to web api , web api validate the credential ,issue JWT token and send back to client . Next time client will send JWT token to web api to perform operations based on token permissions(Scope claim) .

You can click here and here for tutorials .

Nan Yu
  • 26,101
  • 9
  • 68
  • 148